diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-02-20 22:35:32 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-02-20 22:35:32 +0000 |
commit | e5a309118f1950fc5a045958e101fc76f960bfec (patch) | |
tree | 7f7599d75791fb352809db2a965b83d007dd8507 | |
parent | ce1bfa63fcedb45ca3951c24f6e48478c048d9a5 (diff) | |
download | bcfg2-e5a309118f1950fc5a045958e101fc76f960bfec.tar.gz bcfg2-e5a309118f1950fc5a045958e101fc76f960bfec.tar.bz2 bcfg2-e5a309118f1950fc5a045958e101fc76f960bfec.zip |
add new support for client profile assertion
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1750 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r-- | src/lib/Client/Proxy.py | 5 | ||||
-rwxr-xr-x | src/sbin/bcfg2 | 15 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/lib/Client/Proxy.py b/src/lib/Client/Proxy.py index 3e3440da7..a58f8bd53 100644 --- a/src/lib/Client/Proxy.py +++ b/src/lib/Client/Proxy.py @@ -90,3 +90,8 @@ class process_manager(ComponentProxy): '''process manager specific component proxy''' name = 'process-manager' methods = ['CreateProcessGroup', 'GetProcessGroup'] + +class bcfg2(ComponentProxy): + '''bcfg2 client code''' + name = 'bcfg2' + methods = ['AssertProfile', 'GetConfig', 'GetProbes', 'RecvProbeData', 'RecvStats'] diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2 index 97b99ab5c..148bc9204 100755 --- a/src/sbin/bcfg2 +++ b/src/sbin/bcfg2 @@ -14,7 +14,6 @@ from time import time from sys import exc_info from traceback import extract_tb -import xmlrpclib import Bcfg2.Client.Proxy def cb_sigint_handler(signum, frame): @@ -308,9 +307,12 @@ class Client: % (self.setup['file'])) else: # retrieve config from server - proxy = Bcfg2.Client.Proxy.SafeProxy('bcfg2') + proxy = Bcfg2.Client.Proxy.bcfg2() + + if self.setup['profile']: + proxy.AssertProfile(self.setup['profile']) - probe_data = proxy.run_method("GetProbes", ()) + probe_data = proxy.GetProbes() times['probe_download'] = time() @@ -329,12 +331,11 @@ class Client: self.critical_error("executing probes") # upload probe responses - proxy.run_method("RecvProbeData", (probe_info, )) + proxy.RecvProbeData(probe_info) times['probe_upload'] = time() - rawconfig = proxy.run_method("GetConfig", (self.setup['image'], - self.setup['profile'])) + rawconfig = proxy.GetConfig() times['config_download'] = time() @@ -402,7 +403,7 @@ class Client: stats.append(timeinfo) feedback.append(stats) - proxy.run_method("RecvStats", (tostring(feedback),)) + proxy.RecvStats(tostring(feedback)) if __name__ == '__main__': signal(SIGINT, cb_sigint_handler) |