From 19f069c0411b6231ef00347d40bc250ce4da0d18 Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Tue, 19 Feb 2019 07:00:46 -0800 Subject: [PATCH] Change na_ontap_disks to NetAppModule module format (#52279) * Revert "changes to clusteR" This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80. * disk changes * fix author * Revert "Revert "changes to clusteR"" This reverts commit 2c517792115179665d43d74780dc356ca41b9abe. --- lib/ansible/modules/storage/netapp/na_ontap_disks.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/ansible/modules/storage/netapp/na_ontap_disks.py b/lib/ansible/modules/storage/netapp/na_ontap_disks.py index 5900c67fcfc..f968d84bf99 100644 --- a/lib/ansible/modules/storage/netapp/na_ontap_disks.py +++ b/lib/ansible/modules/storage/netapp/na_ontap_disks.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# (c) 2018, NetApp, Inc +# (c) 2018-2019, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function @@ -31,7 +31,6 @@ options: required: true description: - It specifies the node to assign all visible unowned disks. - ''' EXAMPLES = """ @@ -51,6 +50,7 @@ import traceback from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native import ansible.module_utils.netapp as netapp_utils +from ansible.module_utils.netapp_module import NetAppModule HAS_NETAPP_LIB = netapp_utils.has_netapp_lib() @@ -70,10 +70,8 @@ class NetAppOntapDisks(object): supports_check_mode=True ) - parameters = self.module.params - - # set up state variables - self.node = parameters['node'] + self.na_helper = NetAppModule() + self.parameters = self.na_helper.set_parameters(self.module.params) if HAS_NETAPP_LIB is False: self.module.fail_json(msg="the python NetApp-Lib module is required") @@ -106,7 +104,7 @@ class NetAppOntapDisks(object): enable aggregate (online). """ assign_disk = netapp_utils.zapi.NaElement.create_node_with_children( - 'disk-sanown-assign', **{'node-name': self.node, + 'disk-sanown-assign', **{'node-name': self.parameters['node'], 'all': 'true'}) try: self.server.invoke_successfully(assign_disk,