summaryrefslogtreecommitdiffstats
path: root/overlord/test_func.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-26 13:32:01 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-26 13:32:01 -0400
commitbfc293cf605ecca02f8d45e27c33909c7778e649 (patch)
treea8d11afffda391ff72d69ff9408d0c4cf28a022d /overlord/test_func.py
parente3493766701ac84e6d76257659be27c209ecb12e (diff)
downloadfunc-bfc293cf605ecca02f8d45e27c33909c7778e649.tar.gz
func-bfc293cf605ecca02f8d45e27c33909c7778e649.tar.xz
func-bfc293cf605ecca02f8d45e27c33909c7778e649.zip
Two things. First Client("*").hardware.info() and the like now works, due to some clever magic with getattr. You have one client object that can address multiples and returns a hash with the results for each machine. Second, results are hashes, not lists, and we are a bit more clever in returning a return code the CLI .. the highest int wins if there's an int, for instance. Still, return codes are relatively meaningless for multi-control ... the true power is in scripting things.
Diffstat (limited to 'overlord/test_func.py')
-rw-r--r--overlord/test_func.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/overlord/test_func.py b/overlord/test_func.py
index bcce45d..d759a2e 100644
--- a/overlord/test_func.py
+++ b/overlord/test_func.py
@@ -4,13 +4,20 @@
# FIXME: should import the client lib, not XMLRPC lib, when we are done
import xmlrpclib
+import sys
+TEST_GETATTR = True
TEST_PROCESS = False
TEST_VIRT = False
TEST_SERVICES = False
TEST_HARDWARE = False
TEST_SMART = True
+if TEST_GETATTR:
+ import func.overlord.client as func_client
+ print func_client.Client("*").hardware.info()
+ sys.exit(1)
+
# get a connecton (to be replaced by client lib logic)
s = xmlrpclib.ServerProxy("http://127.0.0.1:51234")