Change default pool name for disk provisioning to empty string
This commit is contained in:
@@ -139,7 +139,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Name of the pool where to place new disk. Once disk is created, its pool cannot be changed.
|
- Name of the pool where to place new disk. Once disk is created, its pool cannot be changed.
|
||||||
- This parameter is used when creating new disk and igonred for all other operations.
|
- This parameter is used when creating new disk and igonred for all other operations.
|
||||||
default: default
|
default: empty string
|
||||||
required: no
|
required: no
|
||||||
sep_id:
|
sep_id:
|
||||||
description:
|
description:
|
||||||
@@ -209,7 +209,6 @@ EXAMPLES = '''
|
|||||||
controller_url: "https://cloud.digitalenergy.online"
|
controller_url: "https://cloud.digitalenergy.online"
|
||||||
name: "MyDataDisk01"
|
name: "MyDataDisk01"
|
||||||
sep_id: 1
|
sep_id: 1
|
||||||
pool: "default"
|
|
||||||
size: 50
|
size: 50
|
||||||
account_name: "MyAccount"
|
account_name: "MyAccount"
|
||||||
state: present
|
state: present
|
||||||
@@ -316,7 +315,7 @@ def decort_disk_parameters():
|
|||||||
fallback=(env_fallback, ['DECORT_PASSWORD']),
|
fallback=(env_fallback, ['DECORT_PASSWORD']),
|
||||||
no_log=True),
|
no_log=True),
|
||||||
place_with=dict(type='int', required=False, default=0),
|
place_with=dict(type='int', required=False, default=0),
|
||||||
pool=dict(type='str', required=False, default='default'),
|
pool=dict(type='str', required=False, default=''),
|
||||||
sep_id=dict(type='int', required=False, default=0),
|
sep_id=dict(type='int', required=False, default=0),
|
||||||
size=dict(type='int', required=False),
|
size=dict(type='int', required=False),
|
||||||
state=dict(type='str',
|
state=dict(type='str',
|
||||||
@@ -402,7 +401,7 @@ def main():
|
|||||||
|
|
||||||
disk_should_exist = False
|
disk_should_exist = False
|
||||||
target_sep_id = 0
|
target_sep_id = 0
|
||||||
target_pool = "default"
|
# target_pool = ""
|
||||||
|
|
||||||
if disk_id:
|
if disk_id:
|
||||||
disk_should_exist = True
|
disk_should_exist = True
|
||||||
|
|||||||
@@ -2323,7 +2323,7 @@ class DecortController(object):
|
|||||||
|
|
||||||
return 0, None
|
return 0, None
|
||||||
|
|
||||||
def disk_provision(self, disk_name, size, account_id, sep_id, pool="default", desc="", location=""):
|
def disk_provision(self, disk_name, size, account_id, sep_id, pool_name="", desc="", location=""):
|
||||||
"""Provision Disk according to the specified arguments.
|
"""Provision Disk according to the specified arguments.
|
||||||
Note that disks created by this method will be of type 'D' (data disks).
|
Note that disks created by this method will be of type 'D' (data disks).
|
||||||
If critical error occurs the embedded call to API function will abort further execution
|
If critical error occurs the embedded call to API function will abort further execution
|
||||||
@@ -2361,8 +2361,9 @@ class DecortController(object):
|
|||||||
description=desc,
|
description=desc,
|
||||||
size=size,
|
size=size,
|
||||||
type='D',
|
type='D',
|
||||||
sep_id=sep_id,
|
sep_id=sep_id,)
|
||||||
pool=pool,)
|
if pool_name != "":
|
||||||
|
api_params['pool'] = pool_name
|
||||||
api_resp = self.decort_api_call(requests.post, "/restmachine/cloudapi/disks/create", api_params)
|
api_resp = self.decort_api_call(requests.post, "/restmachine/cloudapi/disks/create", api_params)
|
||||||
if api_resp.status_code == 200:
|
if api_resp.status_code == 200:
|
||||||
ret_disk_id = json.loads(api_resp.content.decode('utf8'))
|
ret_disk_id = json.loads(api_resp.content.decode('utf8'))
|
||||||
|
|||||||
Reference in New Issue
Block a user