PageRenderTime 45ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/silverlining/commands/deactivate.py

https://bitbucket.org/ianb/silverlining/
Python | 15 lines | 12 code | 2 blank | 1 comment | 3 complexity | f95f884b831040e77af9d3611f2c76b3 MD5 | raw file
Possible License(s): GPL-2.0
  1. """Remove an instance from a location"""
  2. from silversupport.shell import ssh
  3. from silversupport import appdata
  4. def command_deactivate(config):
  5. if not config.args.node:
  6. config.args.node = appdata.normalize_location(config.args.locations[0])[0]
  7. if config.args.keep_prev:
  8. option = ['--keep-prev']
  9. else:
  10. option = []
  11. ssh('www-mgr', config.node_hostname,
  12. ['/usr/local/share/silverlining/mgr-scripts/remove-host.py']
  13. + option + config.args.locations)