def delete(fco_api, *args, **kwargs): server_uuid = ctx.instance.runtime_properties.get(RPROP_UUID) job_uuid = delete_resource(fco_api, server_uuid, RT.SERVER, True) \ .resourceUUID cond = cobjects.Job.status == enums.JobStatus.SUCCESSFUL if not wait_for_cond(fco_api, job_uuid, cond, RT.JOB): raise Exception('Failed to delete server')
def delete(fco_api, *args, **kwargs): try: key_uuid = ctx.instance.runtime_properties[RPROP_UUID] get_resource(fco_api, key_uuid, RT.SSHKEY) except (ConflictingResourceError, NoResourceError, KeyError): ctx.logger.warn('SSH key does not exist') return job_uuid = delete_resource(fco_api, key_uuid, RT.SSHKEY, True).resourceUUID cond = cobjects.Job.status == enums.JobStatus.SUCCESSFUL if not wait_for_cond(fco_api, job_uuid, cond, RT.JOB): raise Exception('Failed to delete SSH key')
def delete(fco_api, *args, **kwargs): key_uuid = ctx.instance.runtime_properties.get(RPROP_UUID) job_uuid = delete_resource(fco_api, key_uuid, RT.SERVER, True).resourceUUID cond = cobjects.Job.status == enums.JobStatus.SUCCESSFUL if not wait_for_cond(fco_api, job_uuid, cond, RT.JOB): raise Exception('Failed to delete SSH key')