diff options
-rwxr-xr-x | share/python/console/shutdown.py | 39 | ||||
-rwxr-xr-x | share/python/grid_info.py | 12 |
2 files changed, 0 insertions, 51 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 | ||
diff --git a/share/python/grid_info.py b/share/python/grid_info.py deleted file mode 100755 index 8a89328..0000000 --- a/share/python/grid_info.py +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #!/usr/bin/python | ||
2 | # -*- encoding: utf-8 -*- | ||
3 | import xmlrpclib | ||
4 | |||
5 | # XML-RPC URL (http_listener_port) | ||
6 | gridServerURL = 'http://127.0.0.1:9000' | ||
7 | |||
8 | # instantiate server object | ||
9 | gridServer = xmlrpclib.Server(gridServerURL) | ||
10 | |||
11 | # invoke admin_alert: requires password and message | ||
12 | print gridServer.get_grid_info({}) | ||