From 5f29735987460018212f8f9a79cd2773ca3b45c3 Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Thu, 16 Aug 2018 05:36:28 -0700 Subject: [PATCH] Bug Fixes for ontap_lun.py (#44204) * Bug Fixes for ontap_lun.py * Fix issues --- .../modules/storage/netapp/na_ontap_lun.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/storage/netapp/na_ontap_lun.py b/lib/ansible/modules/storage/netapp/na_ontap_lun.py index a9c645130e..23533eb327 100644 --- a/lib/ansible/modules/storage/netapp/na_ontap_lun.py +++ b/lib/ansible/modules/storage/netapp/na_ontap_lun.py @@ -16,14 +16,14 @@ DOCUMENTATION = ''' module: na_ontap_lun -short_description: Manage NetApp Ontap luns +short_description: Manage NetApp ONTAP luns extends_documentation_fragment: - netapp.na_ontap version_added: '2.6' -author: Sumit Kumar (sumit4@netapp.com), Suhas Bangalore Shekar (bsuhas@netapp.com) +author: NetApp Ansible Team (ng-ansibleteam@netapp.com) description: -- Create, destroy, resize luns on NetApp Ontap. +- Create, destroy, resize luns on NetApp ONTAP. options: @@ -92,6 +92,14 @@ options: type: bool default: True + space_allocation: + description: + - This enables support for the SCSI Thin Provisioning features. If the Host and file system do + not support this do not enable it. + type: bool + default: False + version_added: '2.7' + ''' EXAMPLES = """ @@ -168,6 +176,7 @@ class NetAppOntapLUN(object): vserver=dict(required=True, type='str'), ostype=dict(required=False, type='str', default='image'), space_reserve=dict(required=False, type='bool', default=True), + space_allocation=dict(required=False, type='bool', default=False), )) self.module = AnsibleModule( @@ -195,6 +204,7 @@ class NetAppOntapLUN(object): self.vserver = parameters['vserver'] self.ostype = parameters['ostype'] self.space_reserve = parameters['space_reserve'] + self.space_allocation = parameters['space_allocation'] if HAS_NETAPP_LIB is False: self.module.fail_json(msg="the python NetApp-Lib module is required") @@ -283,7 +293,8 @@ class NetAppOntapLUN(object): 'lun-create-by-size', **{'path': path, 'size': str(self.size), 'ostype': self.ostype, - 'space-reservation-enabled': str(self.space_reserve)}) + 'space-reservation-enabled': str(self.space_reserve), + 'space-allocation-enabled': str(self.space_allocation)}) try: self.server.invoke_successfully(lun_create, enable_tunneling=True)