Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def failed_query(failure):
reasons = getattr(failure.value, 'reasons', None)
if reasons is None:
# Guess it was something else. Do some simpler logging.
write_failure(failure, logger=None)
else:
# It is one of those. Log all of the stuff from inside it.
for reason in reasons:
write_failure(reason, logger=None)
return False
d = cluster.current_nodes()
def failed_query(failure):
reasons = getattr(failure.value, 'reasons', None)
if reasons is None:
# Guess it was something else. Do some simpler logging.
write_failure(failure, logger=None)
else:
# It is one of those. Log all of the stuff from inside it.
for reason in reasons:
write_failure(reason, logger=None)
return False
d = cluster.current_nodes()
def failed_query(failure):
reasons = getattr(failure.value, 'reasons', None)
if reasons is None:
# Guess it was something else. Do some simpler logging.
write_failure(failure, logger=None)
else:
# It is one of those. Log all of the stuff from inside it.
for reason in reasons:
write_failure(reason, logger=None)
return False
d = cluster.current_nodes()
def failed_query(failure):
reasons = getattr(failure.value, 'reasons', None)
if reasons is None:
# Guess it was something else. Do some simpler logging.
write_failure(failure, logger=None)
else:
# It is one of those. Log all of the stuff from inside it.
for reason in reasons:
write_failure(reason, logger=None)
return False
d = cluster.current_nodes()
def handle_request_error(result):
self.rate_measurer.request_failed(result)
write_failure(result)
def got_all_nodes():
d = client.list_nodes()
d.addErrback(write_failure)
def check_node_count(nodes):
print("Waiting for nodes, "
"got {} out of {}".format(len(nodes), count))
return len(nodes) >= count
d.addCallback(check_node_count)
return d
def g(*a, **kw):
action = start_action(action_type=scope + u":" + f.__name__)
with action.context():
d = DeferredContext(maybeDeferred(f, *a, **kw))
d.addErrback(write_failure)
return d.addActionFinish()
return g
def _failed(self, reason):
self._d = None
write_failure(reason)
def instance_error(failure):
Message.log(
message_type="flocker:provision:aws:async_get_node:failed"
)
instance.terminate()
write_failure(failure)
return failure