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

bug fix: aggr_list is empty by default #54916

Merged
merged 1 commit into from
Apr 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/ansible/modules/storage/netapp/na_ontap_svm.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,14 @@ def create_vserver(self):
self.module.fail_json(msg='Error provisioning SVM %s: %s'
% (self.parameters['name'], to_native(e)),
exception=traceback.format_exc())
# add allowed-protocols after creation, since vserver-create doesn't allow this attribute during creation
if self.parameters.get('allowed_protocols'):
self.modify_vserver({'allowed_protocols': self.parameters['allowed_protocols']})
# add allowed-protocols, aggr-list after creation,
# since vserver-create doesn't allow these attributes during creation
options = dict()
for key in ('allowed_protocols', 'aggr_list'):
if self.parameters.get(key):
options[key] = self.parameters[key]
if options:
self.modify_vserver(options)

def delete_vserver(self):
vserver_delete = netapp_utils.zapi.NaElement.create_node_with_children(
Expand Down
2 changes: 2 additions & 0 deletions test/units/modules/storage/netapp/test_na_ontap_svm.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def setUp(self):
'name': 'test_svm',
'root_volume': 'ansible_vol',
'root_volume_aggregate': 'ansible_aggr',
'aggr_list': 'aggr_1,aggr_2',
'ipspace': 'ansible_ipspace',
'subtype': 'default',
'language': 'c.utf_8',
Expand All @@ -113,6 +114,7 @@ def mock_args(self):
'name': self.mock_vserver['name'],
'root_volume': self.mock_vserver['root_volume'],
'root_volume_aggregate': self.mock_vserver['root_volume_aggregate'],
'aggr_list': self.mock_vserver['aggr_list'],
'ipspace': self.mock_vserver['ipspace'],
'comment': self.mock_vserver['comment'],
'subtype': 'default',
Expand Down