/silverlining/commands/clear.py

https://bitbucket.org/ianb/silverlining/ · Python · 13 lines · 8 code · 3 blank · 2 comment · 0 complexity · ea8adae1cee748714e90e93de439a68d MD5 · raw file

  1. """Clear all the data from an application instance"""
  2. from silversupport.shell import ssh
  3. from silversupport.appdata import normalize_location
  4. def command_clear(config):
  5. ## FIXME: this has to be root for bad reasons (it'll try to reinstall the services)
  6. stdout, stderr, returncode = ssh(
  7. 'root', normalize_location(config.args.location)[0],
  8. '/usr/local/share/silverlining/mgr-scripts/update-service.py --location=%(location)s --clear; '
  9. 'sudo -H -u www-data /usr/local/share/silverlining/mgr-scripts/internal-request.py --update-location %(location)s; '
  10. % dict(location=config.args.location))