|
29 | 29 | - Create or delete object store account user
|
30 | 30 | - Remove a specified access key for a user
|
31 | 31 | default: present
|
32 |
| - choices: [ absent, present, remove_key, key_state ] |
| 32 | + choices: [ absent, present, remove_key, keystate ] |
33 | 33 | type: str
|
34 | 34 | name:
|
35 | 35 | description:
|
|
107 | 107 | account: bar
|
108 | 108 | access_key: true
|
109 | 109 | policy:
|
110 |
| - - pure:policy/safemode-configure |
| 110 | + - pure:policy/object-write |
111 | 111 | fb_url: 10.10.10.2
|
112 | 112 | api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641
|
113 | 113 |
|
@@ -364,8 +364,10 @@ def create_s3user(module, blade):
|
364 | 364 | )
|
365 | 365 | if res.status_code != 200:
|
366 | 366 | module.warn(
|
367 |
| - "Failed to add policy {0} to account user {1}. Skipping...".format( |
368 |
| - policy_list[policy], username |
| 367 | + "Failed to add policy {0} to account user {1}. Error: {2}. Skipping...".format( |
| 368 | + policy_list[policy], |
| 369 | + username, |
| 370 | + res.errors[0].message, |
369 | 371 | )
|
370 | 372 | )
|
371 | 373 | if "pure:policy/full-access" not in policy_list:
|
@@ -456,7 +458,7 @@ def main():
|
456 | 458 | policy=dict(type="list", elements="str"),
|
457 | 459 | state=dict(
|
458 | 460 | default="present",
|
459 |
| - choices=["present", "absent", "remove_key", "key_state"], |
| 461 | + choices=["present", "absent", "remove_key", "keystate"], |
460 | 462 | ),
|
461 | 463 | )
|
462 | 464 | )
|
@@ -504,7 +506,7 @@ def main():
|
504 | 506 | create_s3user(module, blade)
|
505 | 507 | elif state == "remove_key" and s3user:
|
506 | 508 | remove_key(module, blade)
|
507 |
| - elif state == "key_state" and s3user: |
| 509 | + elif state == "keystate" and s3user: |
508 | 510 | change_key(module, blade)
|
509 | 511 | else:
|
510 | 512 | module.exit_json(changed=False)
|
|
0 commit comments