diff options
author | Dr Scofield | 2009-01-26 10:11:20 +0000 |
---|---|---|
committer | Dr Scofield | 2009-01-26 10:11:20 +0000 |
commit | 02c12de6c1077760e3cd965cb18b73ba48793bcb (patch) | |
tree | b5b1353fdaaf5974d796eb06d3ee777b5f05eaff /share/python/console/shutdown.py | |
parent | more eventqueue IM nonsense (diff) | |
download | opensim-SC-02c12de6c1077760e3cd965cb18b73ba48793bcb.zip opensim-SC-02c12de6c1077760e3cd965cb18b73ba48793bcb.tar.gz opensim-SC-02c12de6c1077760e3cd965cb18b73ba48793bcb.tar.bz2 opensim-SC-02c12de6c1077760e3cd965cb18b73ba48793bcb.tar.xz |
~ cleaning up code base: dropping share/python
Diffstat (limited to 'share/python/console/shutdown.py')
-rwxr-xr-x | share/python/console/shutdown.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/share/python/console/shutdown.py b/share/python/console/shutdown.py deleted file mode 100755 index 65f8255..0000000 --- a/share/python/console/shutdown.py +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | #!/usr/bin/python | ||
2 | # -*- encoding: utf-8 -*- | ||
3 | |||
4 | import ConfigParser | ||
5 | import xmlrpclib | ||
6 | import optparse | ||
7 | import os.path | ||
8 | |||
9 | if __name__ == '__main__': | ||
10 | parser = optparse.OptionParser() | ||
11 | parser.add_option('-c', '--config', dest = 'config', help = 'config file', metavar = 'CONFIG') | ||
12 | parser.add_option('-s', '--server', dest = 'server', help = 'URI for the grid server', metavar = 'SERVER') | ||
13 | parser.add_option('-p', '--password', dest = 'password', help = 'password for the grid server', metavar = 'PASSWD') | ||
14 | (options, args) = parser.parse_args() | ||
15 | |||
16 | configFile = options.config | ||
17 | if not configFile: | ||
18 | if os.path.isfile(os.path.expanduser('~/.opensim-console.rc')): | ||
19 | configFile = os.path.expanduser('~/.opensim-console.rc') | ||
20 | if not configFile: | ||
21 | parser.error('missing option config') | ||
22 | sys.exit(1) | ||
23 | |||
24 | config = ConfigParser.ConfigParser() | ||
25 | config.readfp(open(configFile)) | ||
26 | |||
27 | server = config.get('opensim', 'server') | ||
28 | password = config.get('opensim', 'password') | ||
29 | |||
30 | if options.server: server = options.server | ||
31 | if options.password: password = options.password | ||
32 | |||
33 | gridServer = xmlrpclib.Server(server) | ||
34 | res = gridServer.admin_shutdown({'password': password}) | ||
35 | |||
36 | if res['success'] == 'true': | ||
37 | print 'shutdown of %s initiated' % server | ||
38 | else: | ||
39 | print 'shutdown of %s failed' % server | ||