Add logic for processing vins_name parameter
This commit is contained in:
@@ -66,13 +66,6 @@ class decort_lb(DecortController):
|
||||
self.result['msg'] = "Specified RG ID {} not found.".format(arg_amodule.params['vins_id'])
|
||||
self.amodule.fail_json(**self.result)
|
||||
|
||||
if arg_amodule.params['vins_id']:
|
||||
self.vins_id, self.vins_facts = self.vins_find(arg_amodule.params['vins_id'])
|
||||
if not self.vins_id:
|
||||
self.result['failed'] = True
|
||||
self.result['msg'] = "Specified ViNS ID {} not found.".format(arg_amodule.params['vins_id'])
|
||||
self.amodule.fail_json(**self.result)
|
||||
|
||||
elif arg_amodule.params['account_id'] or arg_amodule.params['account_name'] != "":
|
||||
|
||||
if not arg_amodule.params['rg_name']:
|
||||
@@ -88,6 +81,30 @@ class decort_lb(DecortController):
|
||||
self.amodule.fail_json(**self.result)
|
||||
self.rg_id, self.rg_facts = self.rg_find(self.acc_id,0, arg_rg_name=arg_amodule.params['rg_name'])
|
||||
|
||||
if arg_amodule.params['vins_id']:
|
||||
self.vins_id, self.vins_facts = self.vins_find(
|
||||
vins_id=arg_amodule.params['vins_id']
|
||||
)
|
||||
if not self.vins_id:
|
||||
self.result['failed'] = True
|
||||
self.result['msg'] = (
|
||||
f'Specified ViNS ID {arg_amodule.params["vins_id"]}'
|
||||
f' not found'
|
||||
)
|
||||
self.amodule.fail_json(**self.result)
|
||||
elif arg_amodule.params['vins_name']:
|
||||
self.vins_id, self.vins_facts = self.vins_find(
|
||||
vins_id=arg_amodule.params['vins_id'],
|
||||
vins_name=arg_amodule.params['vins_name'],
|
||||
rg_id=self.rg_id)
|
||||
if not self.vins_id:
|
||||
self.result['failed'] = True
|
||||
self.result['msg'] = (
|
||||
f'Specified ViNS name {arg_amodule.params["vins_name"]}'
|
||||
f' not found in RG ID {self.rg_id}'
|
||||
)
|
||||
self.amodule.fail_json(**self.result)
|
||||
|
||||
if self.rg_id and self.vins_id:
|
||||
self.lb_id, self.lb_facts = self.lb_find(0,arg_amodule.params['lb_name'],self.rg_id)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user