From c6f12eea32ee016570b4b6b56eccd4944d29643c Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Mon, 8 Apr 2019 05:11:42 -0700 Subject: [PATCH] push fix (#54916) --- lib/ansible/modules/storage/netapp/na_ontap_svm.py | 11 ++++++++--- .../units/modules/storage/netapp/test_na_ontap_svm.py | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/storage/netapp/na_ontap_svm.py b/lib/ansible/modules/storage/netapp/na_ontap_svm.py index 5d24ea68f76..75418c709e3 100644 --- a/lib/ansible/modules/storage/netapp/na_ontap_svm.py +++ b/lib/ansible/modules/storage/netapp/na_ontap_svm.py @@ -308,9 +308,14 @@ class NetAppOntapSVM(object): 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( diff --git a/test/units/modules/storage/netapp/test_na_ontap_svm.py b/test/units/modules/storage/netapp/test_na_ontap_svm.py index 293b34878dc..fe3c918eeab 100644 --- a/test/units/modules/storage/netapp/test_na_ontap_svm.py +++ b/test/units/modules/storage/netapp/test_na_ontap_svm.py @@ -101,6 +101,7 @@ class TestMyModule(unittest.TestCase): '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', @@ -113,6 +114,7 @@ class TestMyModule(unittest.TestCase): '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',