diff options
| author | Seth Vidal <skvidal@fedoraproject.org> | 2007-09-25 10:41:40 -0400 |
|---|---|---|
| committer | Seth Vidal <skvidal@fedoraproject.org> | 2007-09-25 10:41:40 -0400 |
| commit | 4ce41f6eb4bdef401dd767d48ea98a0883090972 (patch) | |
| tree | f116135c24af74d335a16a28babe94215e961321 /client | |
| parent | 04d9598cef8cd5501acba95040ee46d73c52dbef (diff) | |
| parent | 6bf3d8bee599802c95832cbdae904ffce1053938 (diff) | |
Merge branch 'master' of ssh://git.fedoraproject.org/git/hosted/func
* 'master' of ssh://git.fedoraproject.org/git/hosted/func:
Renamed server to minion and client to overlord
Diffstat (limited to 'client')
| -rw-r--r-- | client/__init__.py | 0 | ||||
| -rwxr-xr-x | client/dumb_client.py | 50 | ||||
| -rw-r--r-- | client/test_func.py | 51 |
3 files changed, 0 insertions, 101 deletions
diff --git a/client/__init__.py b/client/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/client/__init__.py +++ /dev/null diff --git a/client/dumb_client.py b/client/dumb_client.py deleted file mode 100755 index c6a31ed..0000000 --- a/client/dumb_client.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/python - - -# all the cool kids would use optparse instead -import getopt -import sys -import xmlrpclib - -myname, argv = sys.argv[0], sys.argv[1:] - -def usage(): - return "Usage: %s [ --help ] [ --verbose ] [ --server=http://hostname:port ] method arg1 [ ... ]" % myname - -verbose = 0 -server = "http://127.0.0.1:51234" - -try: - opts, args = getopt.getopt(argv, "hvs:", - ["help", - "verbose", - "server="]) -except getopt.error, e: - print _("Error parsing list arguments: %s") % e - print usage() - sys.exit() - -for (opt, val) in opts: - print "opt = %s, val = %s" % (opt, val) - if opt in ["-h", "--help"]: - print usage() - sys.exit() - if opt in ["-v", "--verbose"]: - verbose = verbose + 1 - if opt in ["-s", "--server"]: - server = val - -if len(args) < 1: - print usage() - sys.exit() - -s = xmlrpclib.ServerProxy(server) - -method = args[0] -print "calling %s with args: %s" % (method, args[1:]) - -# thats some pretty code right there aint it? -akl -# we can't call "call" on s, since thats a rpc, so -# we call gettatr around it. -print getattr(s, method)(*args[1:]) - diff --git a/client/test_func.py b/client/test_func.py deleted file mode 100644 index bcce45d..0000000 --- a/client/test_func.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/python - - -# FIXME: should import the client lib, not XMLRPC lib, when we are done - -import xmlrpclib - -TEST_PROCESS = False -TEST_VIRT = False -TEST_SERVICES = False -TEST_HARDWARE = False -TEST_SMART = True - -# get a connecton (to be replaced by client lib logic) -s = xmlrpclib.ServerProxy("http://127.0.0.1:51234") - -# here's the basic test... -print s.test.add(1, 2) - -if TEST_SMART: - print s.smart.info() - -if TEST_PROCESS: - print s.process.info() - # print s.process.pkill("thunderbird") - -# here's the service module testing -if TEST_SERVICES: - print s.service.restart("httpd") - -if TEST_HARDWARE: - print s.hardware.info() - -# this is so I can remember how the virt module works -if TEST_VIRT: - - # example of using koan to install a virtual machine - #s.virt_install("mdehaan.rdu.redhat.com","profileX") - - # wait ... - vms = s.virt.list_vms() - # example of stopping all stopped virtual machines - print "list of virtual instances = %s" % vms - for vm in vms: - status = s.virt.status(vm) - print status - if status == "shutdown": - s.virt.start(vm) - -# add more tests here - |
