Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update na_elementsw_access_group.py #57513

Closed
wants to merge 1 commit into from

Conversation

arcticgenes
Copy link

SUMMARY

account_id was not being passed correctly with username. String can now be passed and will return correctly.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

na_elementsw_access_group

ADDITIONAL INFORMATION
  na_elementsw_access_group:
    hostname: "{{ elementsw_hostname }}"
    username: "{{ elementsw_username }}"
    password: "{{ elementsw_password }}"
    account_id: "{{ nacluster_accountname }}"
    state: present
    name: "{{ navolume_accessgroup_name }}"
    volumes:
      - "{{ volume_name }}"
    "changed": false,
    "rc": 1
}

MSG:

MODULE FAILURE
See stdout/stderr for the exact error


MODULE_STDERR:

2019-06-06 23:31:26,392 - solidfire.Element - INFO - {"method": "GetAPI", "id": 0, "params": {}}
2019-06-06 23:31:26,577 - solidfire.Element - INFO - Connected to 10.39.48.5 using API version 10.4
2019-06-06 23:31:26,578 - solidfire.Element - INFO -

                                               77
                                              7777
                                               77
                                               ==
                             77IIIIIIIIIIIIIIIIII777
                           =7                       7=
                           7                         7
                          =7                         7=
                          =7                         7=
                         =77   7777777777777777777   77=
                        7777  777777777777777777777  7777
                        7777   7777777777777777777   7777
                         =77                         77=
                          =7                         7=
                           7                         7
                           7=                       =7
                            77=                   =77
                              =7777777777777777777=

                               ====IIIIIIIIII=====
                         =77777=                 =77777=
                     =777=                             =777=
                 =777=                                     =777=

                           NetApp SolidFire Version 10.4


2019-06-06 23:31:26,578 - solidfire.Element - INFO - {"method": "GetAccountByName", "id": 1, "params": {"username": "admin"}}
2019-06-06 23:31:26,731 - solidfire.Element - INFO - {"method": "ListVolumesForAccount", "id": 2, "params": {"accountID": "admin"}}
Traceback (most recent call last):
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1559863885.8599882-255882656119489/AnsiballZ_na_elementsw_access_group.py", line 114, in <module>
    _ansiballz_main()
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1559863885.8599882-255882656119489/AnsiballZ_na_elementsw_access_group.py", line 106, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1559863885.8599882-255882656119489/AnsiballZ_na_elementsw_access_group.py", line 49, in invoke_module
    imp.load_module('__main__', mod, module, MOD_DESC)
  File "/usr/lib/python3.5/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.5/imp.py", line 170, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 626, in _exec
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/tmp/ansible_na_elementsw_access_group_payload_ma4h_aif/__main__.py", line 368, in <module>
  File "/tmp/ansible_na_elementsw_access_group_payload_ma4h_aif/__main__.py", line 364, in main
  File "/tmp/ansible_na_elementsw_access_group_payload_ma4h_aif/__main__.py", line 306, in apply
  File "/tmp/ansible_na_elementsw_access_group_payload_ma4h_aif/__main__.py", line 229, in get_volume_id
  File "/tmp/ansible_na_elementsw_access_group_payload_ma4h_aif/ansible_na_elementsw_access_group_payload.zip/ansible/module_utils/netapp_elementsw_module.py", line 96, in volume_exists
  File "/tmp/ansible_na_elementsw_access_group_payload_ma4h_aif/ansible_na_elementsw_access_group_payload.zip/ansible/module_utils/netapp_elementsw_module.py", line 52, in get_volume_id
  File "/usr/local/lib/python3.5/dist-packages/solidfire/__init__.py", line 5529, in list_volumes_for_account
    since=1.0
  File "/usr/local/lib/python3.5/dist-packages/solidfire/common/__init__.py", line 704, in send_request
    response["error"]["message"])
solidfire.common.ApiServerError: ApiServerError(method_name="ListVolumesForAccount", err_json=500 xInvalidParameterType accountID: Invalid type: expected uint64_t but found "admin"
)```

account_id was not being passed correctly with username.  String can now be passed and will return correctly.
@ansibot
Copy link
Contributor

ansibot commented Jun 6, 2019

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. committer_review In order to be merged, this PR must follow the certified review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. netapp new_contributor This PR is the first contribution by a new community member. python3 small_patch storage support:certified This issue/PR relates to certified code. traceback This issue/PR includes a traceback. labels Jun 6, 2019
@@ -216,8 +216,8 @@ def get_account_id(self):
# Validate account id
# Return account_id if found, None otherwise
try:
account_id = self.elementsw_helper.account_exists(self.account_id)
return account_id
self.account_id = self.elementsw_helper.account_exists(self.account_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is really in line 233

volume_id = self.elementsw_helper.volume_exists(volume, self.account_id)

it should be

volume_id = self.elementsw_helper.volume_exists(volume, self.account_id_valid)

as we are trying to preserver self.account_id for an error message. We want to preserve the original value.

(I agree it's a bit confusing as written, and could be better to use a new name for the original value)

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Jun 11, 2019
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jun 19, 2019
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. support:community This issue/PR relates to code supported by the Ansible community. and removed committer_review In order to be merged, this PR must follow the certified review workflow. support:certified This issue/PR relates to certified code. labels Jul 30, 2019
@lonico
Copy link
Contributor

lonico commented Aug 27, 2019

Duplicate of #60887

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Aug 27, 2019
@ansibot ansibot added support:certified This issue/PR relates to certified code. and removed support:community This issue/PR relates to code supported by the Ansible community. labels Mar 26, 2020
@ansibot ansibot added collection Related to Ansible Collections work collection:red8labs.ontap and removed support:certified This issue/PR relates to certified code. labels Apr 29, 2020
@ansibot ansibot added needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md support:community This issue/PR relates to code supported by the Ansible community. labels Apr 29, 2020
@ansibot
Copy link
Contributor

ansibot commented Aug 15, 2020

Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.

For further information, please see:
https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md

@ansibot ansibot closed this Aug 15, 2020
@ansible ansible locked and limited conversation to collaborators Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bot_closed bug This issue/PR relates to a bug. collection Related to Ansible Collections work module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. netapp new_contributor This PR is the first contribution by a new community member. python3 small_patch stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. storage support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants