Skip to content

Instantly share code, notes, and snippets.

@dankilman
Created May 17, 2016 19:25
Show Gist options
  • Save dankilman/4cccd155cbffcec9a68291497e2c09da to your computer and use it in GitHub Desktop.
Save dankilman/4cccd155cbffcec9a68291497e2c09da to your computer and use it in GitHub Desktop.
update improvement
from cloudify import ctx
@operation
def some_op(**kwargs):
# do wonderful things
def handler(current_runtime_properties):
# make modification
current_runtime_properties.setdefault('prop', []).append('some_value')
# The implementation will take care of retrying the handler specifically when a ConflictError occurs
ctx.instance.update(update_handler=handler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment