Merge branch 'dev_bsgroup_rc-5.2.6' into 'rc-5.2.6'
decort_group module bug fixes See merge request rudecs/dev/decort-ansible!80
This commit is contained in:
@@ -3868,11 +3868,12 @@ class DecortController(object):
|
||||
self.result['waypoints'] = "{} -> {}".format(self.result['waypoints'], "group_find")
|
||||
|
||||
if group_id == 0:
|
||||
try:
|
||||
i = bs_info['groupsName'].index(group_name)
|
||||
except:
|
||||
return 0,None
|
||||
group_id = int(bs_info['groups'][i])
|
||||
for group in bs_info['groups']:
|
||||
if group['name'] == group_name:
|
||||
return self._group_get_by_id(bs_id=bs_id,
|
||||
g_id=group['id'])
|
||||
return 0, None
|
||||
|
||||
return self._group_get_by_id(bs_id,group_id)
|
||||
|
||||
def group_state(self,bs_id,gr_id,desired_state):
|
||||
@@ -3966,7 +3967,7 @@ class DecortController(object):
|
||||
else:
|
||||
list_extnet.append(net['id'])
|
||||
|
||||
if gr_dict['vinses'] != list_vins:
|
||||
if sorted(gr_dict['vinses']) != sorted(list_vins):
|
||||
api_url = "/restmachine/cloudapi/bservice/groupUpdateVins"
|
||||
api_params = dict(
|
||||
serviceId=bs_id,
|
||||
@@ -3987,11 +3988,7 @@ class DecortController(object):
|
||||
):
|
||||
|
||||
self.result['waypoints'] = "{} -> {}".format(self.result['waypoints'], "group_provision")
|
||||
|
||||
list_vins= list()
|
||||
for net in arg_network:
|
||||
if net['type'] == 'VINS':
|
||||
list_vins.append(net['id'])
|
||||
|
||||
api_url = "/restmachine/cloudapi/bservice/groupAdd"
|
||||
api_params = dict(
|
||||
serviceId = bs_id,
|
||||
@@ -4003,13 +4000,15 @@ class DecortController(object):
|
||||
imageId = arg_image_id,
|
||||
driver = arg_driver,
|
||||
role = arg_role,
|
||||
vinses = list_vins,
|
||||
vinses = [n['id'] for n in arg_network if n['type'] == 'VINS'],
|
||||
extnets = [n['id'] for n in arg_network if n['type'] == 'EXTNET'],
|
||||
timeoutStart = arg_timeout
|
||||
)
|
||||
self.decort_api_call(requests.post, api_url, api_params)
|
||||
api_resp = self.decort_api_call(requests.post, api_url, api_params)
|
||||
new_bsgroup_id = int(api_resp.text)
|
||||
self.result['failed'] = False
|
||||
self.result['changed'] = True
|
||||
return
|
||||
return new_bsgroup_id
|
||||
|
||||
def group_delete(self,bs_id,gr_id):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user