|
|
@ -829,7 +829,7 @@ def main():
|
|
|
|
if subj.comp_info['status'] in ("DISABLED", "MIGRATING", "DELETING", "DESTROYING", "ERROR", "REDEPLOYING"):
|
|
|
|
if subj.comp_info['status'] in ("DISABLED", "MIGRATING", "DELETING", "DESTROYING", "ERROR", "REDEPLOYING"):
|
|
|
|
# cannot do anything on the existing Compute in the listed states
|
|
|
|
# cannot do anything on the existing Compute in the listed states
|
|
|
|
subj.error() # was subj.nop()
|
|
|
|
subj.error() # was subj.nop()
|
|
|
|
elif subj.comp_info['status'] == "ENABLED":
|
|
|
|
elif subj.comp_info['status'] in ("ENABLED", "DISABLED"):
|
|
|
|
if amodule.params['state'] == 'absent':
|
|
|
|
if amodule.params['state'] == 'absent':
|
|
|
|
subj.destroy()
|
|
|
|
subj.destroy()
|
|
|
|
elif amodule.params['state'] in ('present', 'paused', 'poweredon', 'poweredoff', 'halted'):
|
|
|
|
elif amodule.params['state'] in ('present', 'paused', 'poweredon', 'poweredoff', 'halted'):
|
|
|
@ -843,8 +843,9 @@ def main():
|
|
|
|
_, subj.comp_info, _ = subj.compute_find(comp_id=subj.comp_id)
|
|
|
|
_, subj.comp_info, _ = subj.compute_find(comp_id=subj.comp_id)
|
|
|
|
subj.modify()
|
|
|
|
subj.modify()
|
|
|
|
elif amodule.params['state'] == 'absent':
|
|
|
|
elif amodule.params['state'] == 'absent':
|
|
|
|
subj.nop()
|
|
|
|
# subj.nop()
|
|
|
|
subj.comp_should_exist = False
|
|
|
|
# subj.comp_should_exist = False
|
|
|
|
|
|
|
|
subj.destroy()
|
|
|
|
elif amodule.params['state'] in ('paused', 'poweredoff', 'halted'):
|
|
|
|
elif amodule.params['state'] in ('paused', 'poweredoff', 'halted'):
|
|
|
|
subj.error()
|
|
|
|
subj.error()
|
|
|
|
elif subj.comp_info['status'] == "DESTROYED":
|
|
|
|
elif subj.comp_info['status'] == "DESTROYED":
|
|
|
|