Skip to content

Instantly share code, notes, and snippets.

@tehasdf
Created June 23, 2016 06:57
Show Gist options
  • Save tehasdf/7d1b8a02606fad44ba70e63ce2b8deb5 to your computer and use it in GitHub Desktop.
Save tehasdf/7d1b8a02606fad44ba70e63ce2b8deb5 to your computer and use it in GitHub Desktop.
from cloudify.decorators import workflow, operation
from cloudify.workflows import ctx as workflow_ctx
@operation
def sometask(ctx):
ctx.logger.info('ok {0}'.format(ctx)) # ctx is a CloudifyContext, not a WorkflowContext
@workflow
def updatenow(**_):
'''Run update-now'''
workflow_ctx.logger.info('Executing "updatenow" workflow {0!r}'.format(_))
workflow_ctx.execute_task('foo.sometask')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment