Skip to content

purefa_policy fails when management password policy lockout_duration is null #1030

Description

@Kainim

Describe the bug

everpure.flasharray.purefa_policy fails when managing the built-in
FlashArray management password policy if the API returns
lockout_duration as null.

The module directly accesses pwd_policy.lockout_duration. With the
installed py-pure-client, a model field whose value is null raises
AttributeError, so the module fails before it can compare or apply the
requested policy configuration.

I assume this will also fail for other attributes returning null:

  • enforce_dictionary_check
  • enforce_username_check
  • lockout_duration
  • min_character_groups
  • min_characters_per_group
  • min_password_length

To Reproduce

  1. Use a FlashArray that supports REST API 2.46.

  2. Ensure the existing management password policy has lockout_duration
    unset.

  3. Confirm the API response from:

    GET /api/2.46/policies/password?names=management
    

    contains:

    {
      "lockout_duration": null
    }
  4. Run this task:

    - name: Configure management password policy
      everpure.flasharray.purefa_policy:
        name: management
        policy: password
        min_password_length: 14
        min_character_groups: 4
        min_characters_per_group: 1
        enforce_dictionary_check: true
        enforce_username_check: true
        password_history: 24
        max_login_attempts: 5
        lockout_duration: 900
  5. Observe the failure:

    File ".../purefa_policy.py", line 2007, in update_policy
        "lockout_duration": pwd_policy.lockout_duration,
    AttributeError
    

Expected behavior

A missing or null lockout_duration should be treated as “not configured.”
The module should then compare it with the requested value and apply the
requested password-policy settings.

For example, the module should safely retrieve the value:

"lockout_duration": getattr(pwd_policy, "lockout_duration", None),

The same safe handling may be required for other nullable password-policy
fields accessed directly.

Screenshots

Not applicable. A sanitized raw JSON response and traceback can be attached if
useful.

Desktop

  • OS: Linux
  • Browser: Not applicable
  • Version: Not applicable

Smartphone

Not applicable.

Additional context

  • everpure.flasharray collection version: 1.44.0
  • py-pure-client version: 1.90.0
  • Python version: 3.14
  • FlashArray REST API version: 2.46
  • The collection's purefa_policy module currently declares password-policy
    support from REST API 2.34; password-policy management is documented as
    introduced in REST API 2.39.

Do not include API tokens, session tokens, or unredacted array identifiers in
any attached JSON or logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions