diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-07-11 10:48:44 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-07-11 10:48:44 -0400 |
commit | b35d708ea1e56a8d79b2f4e5651c57ebc99e7f8d (patch) | |
tree | 6459df3f2e966f3f82ed40f2997737c49be483a6 /src/sbin/bcfg2 | |
parent | 0140c43ad7392725c8ca0e2d59c84b07bc4628bc (diff) | |
download | bcfg2-b35d708ea1e56a8d79b2f4e5651c57ebc99e7f8d.tar.gz bcfg2-b35d708ea1e56a8d79b2f4e5651c57ebc99e7f8d.tar.bz2 bcfg2-b35d708ea1e56a8d79b2f4e5651c57ebc99e7f8d.zip |
added feature to allow clients to declare their version to server
Diffstat (limited to 'src/sbin/bcfg2')
-rwxr-xr-x | src/sbin/bcfg2 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2 index 349826676..4fbbef877 100755 --- a/src/sbin/bcfg2 +++ b/src/sbin/bcfg2 @@ -18,6 +18,8 @@ import Bcfg2.Client.Tools # Compatibility imports from Bcfg2.Bcfg2Py3k import xmlrpclib +from Bcfg2.version import __version__ + import Bcfg2.Proxy import Bcfg2.Logger @@ -152,6 +154,24 @@ class Client: raise SystemExit(1) try: + probe_data = proxy.DeclareVersion(__version__) + except xmlrpclib.Fault: + err = sys.exc_info()[1] + if (err.faultCode == xmlrpclib.METHOD_NOT_FOUND or + (err.faultCode == 7 and + err.faultString.startswith("Unknown method"))): + self.logger.debug("Server does not support declaring " + "client version") + else: + self.logger.error("Failed to declare version: %s" % err) + except (Bcfg2.Proxy.ProxyError, + Bcfg2.Proxy.CertificateError, + socket.gaierror, + socket.error): + err = sys.exc_info()[1] + self.logger.error("Failed to declare version: %s" % err) + + try: probe_data = proxy.GetProbes() except (Bcfg2.Proxy.ProxyError, Bcfg2.Proxy.CertificateError, |