Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def restart(repo, batch='5'):
- '''
- Restart the service associated with this repo. If no service is associated
- this call will do nothing.
- '''
- grain = __get_conf(repo, 'deployment_repo_grains')
- if not grain:
- return "No grain defined for this repo."
- grain = "deployment_target:" + grain
- client = salt.client.LocalClient(__opts__['conf_file'])
- cmd = 'deploy.restart'
- # comma in the tuple is a workaround for a bug in salt
- arg = (repo,)
- for test in client.cmd_batch(grain, cmd, expr_form='grain', arg=arg,
- timeout=10, ret='deploy_redis', batch=batch):
- print "{}".format(test)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement