Skip to content

Instantly share code, notes, and snippets.

@kevinquinnyo
Created January 26, 2016 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinquinnyo/126f6e4eda7ea995d5d4 to your computer and use it in GitHub Desktop.
Save kevinquinnyo/126f6e4eda7ea995d5d4 to your computer and use it in GitHub Desktop.
#!py
def test(states):
condition = False
if condition:
states['my_required_state_if_not_staging'] = {
'cmd.run': [
{'name': 'touch /tmp/my_required_state_if_not_staging'}
]
}
states['state_with_requisite'] = {
'cmd.run': [
{'name': 'touch /tmp/state_with_requisite'},
{'require': [
{'cmd': 'my_required_state_if_not_staging'}
]}
]
}
return states
def run():
states = {}
states = test(states)
return states
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment