Fix logic of LB deleting from Recycle Bin and LB list getting
This commit is contained in:
@@ -322,7 +322,8 @@ def main():
|
||||
elif decon.lb_facts['status'] == "DELETED":
|
||||
if amodule.params['state'] in ['present', 'enabled']:
|
||||
decon.action(restore=True)
|
||||
elif amodule.params['state'] == 'absent':
|
||||
elif (amodule.params['state'] == 'absent' and
|
||||
amodule.params['permanently']):
|
||||
decon.delete()
|
||||
elif amodule.params['state'] == 'disabled':
|
||||
decon.error()
|
||||
|
||||
@@ -4056,8 +4056,8 @@ class DecortController(object):
|
||||
self.result['msg'] = "_rg_listlb(): zero RG ID specified."
|
||||
self.amodule.fail_json(**self.result)
|
||||
|
||||
api_params = dict(rgId=rg_id)
|
||||
api_resp = self.decort_api_call(requests.post, "/restmachine/cloudapi/rg/listLb", api_params)
|
||||
api_params = dict(rgId=rg_id, includedeleted=True)
|
||||
api_resp = self.decort_api_call(requests.post, "/restmachine/cloudapi/lb/list", api_params)
|
||||
if api_resp.status_code == 200:
|
||||
ret_rg_vins_list = json.loads(api_resp.content.decode('utf8'))
|
||||
else:
|
||||
@@ -4071,7 +4071,7 @@ class DecortController(object):
|
||||
|
||||
@returns: LB ID and dictionary with LB facts.
|
||||
"""
|
||||
LB_INVALID_STATES = ["ENABLING", "DISABLING", "DELETING", "DELETED", "DESTROYING", "DESTROYED"]
|
||||
LB_INVALID_STATES = ["ENABLING", "DISABLING", "DELETING", "DESTROYING", "DESTROYED"]
|
||||
|
||||
ret_lb_id = 0
|
||||
ret_lb_facts = None
|
||||
|
||||
Reference in New Issue
Block a user