Bug Fixes for ontap_lun.py (#44204)

* Bug Fixes for ontap_lun.py

* Fix issues
This commit is contained in:
Chris Archibald 2018-08-16 05:36:28 -07:00 committed by ansibot
commit 5f29735987

View file

@ -16,14 +16,14 @@ DOCUMENTATION = '''
module: na_ontap_lun module: na_ontap_lun
short_description: Manage NetApp Ontap luns short_description: Manage NetApp ONTAP luns
extends_documentation_fragment: extends_documentation_fragment:
- netapp.na_ontap - netapp.na_ontap
version_added: '2.6' 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: description:
- Create, destroy, resize luns on NetApp Ontap. - Create, destroy, resize luns on NetApp ONTAP.
options: options:
@ -92,6 +92,14 @@ options:
type: bool type: bool
default: True 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 = """ EXAMPLES = """
@ -168,6 +176,7 @@ class NetAppOntapLUN(object):
vserver=dict(required=True, type='str'), vserver=dict(required=True, type='str'),
ostype=dict(required=False, type='str', default='image'), ostype=dict(required=False, type='str', default='image'),
space_reserve=dict(required=False, type='bool', default=True), space_reserve=dict(required=False, type='bool', default=True),
space_allocation=dict(required=False, type='bool', default=False),
)) ))
self.module = AnsibleModule( self.module = AnsibleModule(
@ -195,6 +204,7 @@ class NetAppOntapLUN(object):
self.vserver = parameters['vserver'] self.vserver = parameters['vserver']
self.ostype = parameters['ostype'] self.ostype = parameters['ostype']
self.space_reserve = parameters['space_reserve'] self.space_reserve = parameters['space_reserve']
self.space_allocation = parameters['space_allocation']
if HAS_NETAPP_LIB is False: if HAS_NETAPP_LIB is False:
self.module.fail_json(msg="the python NetApp-Lib module is required") 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, 'lun-create-by-size', **{'path': path,
'size': str(self.size), 'size': str(self.size),
'ostype': self.ostype, '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: try:
self.server.invoke_successfully(lun_create, enable_tunneling=True) self.server.invoke_successfully(lun_create, enable_tunneling=True)