Advertisement
Guest User

Untitled

a guest
Dec 10th, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. def restart(repo, batch='5'):
  2. '''
  3. Restart the service associated with this repo. If no service is associated
  4. this call will do nothing.
  5. '''
  6. grain = __get_conf(repo, 'deployment_repo_grains')
  7. if not grain:
  8. return "No grain defined for this repo."
  9. grain = "deployment_target:" + grain
  10. client = salt.client.LocalClient(__opts__['conf_file'])
  11. cmd = 'deploy.restart'
  12. # comma in the tuple is a workaround for a bug in salt
  13. arg = (repo,)
  14. for test in client.cmd_batch(grain, cmd, expr_form='grain', arg=arg,
  15. timeout=10, ret='deploy_redis', batch=batch):
  16. print "{}".format(test)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement