PageRenderTime 92ms CodeModel.GetById 61ms app.highlight 1ms RepoModel.GetById 29ms app.codeStats 0ms

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