Skip to content

Instantly share code, notes, and snippets.

@dfilppi
Created June 30, 2015 17:37
Show Gist options
  • Save dfilppi/b4859ea82c7ecb0f908c to your computer and use it in GitHub Desktop.
Save dfilppi/b4859ea82c7ecb0f908c to your computer and use it in GitHub Desktop.
cfy-coordinator-dbhosts
rtkey="mongod_host_{}".format(ctx.target.instance.id)
try:
ctx.source.instance.runtime_properties[rtkey]=rtval
ctx.source.instance.update()
except rest_exceptions.CloudifyClientError as e:
if 'conflict' in str(e):
ctx.operation.retry(
message='Backends updated concurrently, retrying.',
retry_after=random.randint(1,3))
else:
raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment