Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def wait():
LOG.debug("Wait operation %s...", operation)
try:
state, info = self.api.operation_info(operation)
LOG.debug("Operation details: %s.", info)
except pylxd_exc.APIError as e:
LOG.exception(e)
return True
except Exception as e:
LOG.exception(e)
raise exception.ManilaException(
_("Cannot get operation info: %s.") % e
)
return (
six.text_type(info["metadata"]["status"]).lower() != "running"
)
def get_lxd_error(state, data):
status_code = data.get('error_code')
error = data.get('error')
raise exceptions.APIError(error, status_code)