Block xen_cpu from running with XenAPI until we switch all of XVM 0.0.5
authorQuentin Smith <quentin@mit.edu>
Wed, 26 Nov 2008 04:44:57 +0000 (23:44 -0500)
committerQuentin Smith <quentin@mit.edu>
Wed, 26 Nov 2008 04:44:57 +0000 (23:44 -0500)
svn path=/trunk/packages/xvm-munin-config/; revision=1783

debian/changelog
host/usr/share/xvm-munin-host-config/plugins/xen_cpu

index 56ccf75..486e27c 100644 (file)
@@ -4,13 +4,14 @@ xvm-munin-config (0.0.5) unstable; urgency=low
   * Fix typos in xen_cpu script for XenAPI code
   * Bump theoretical CPU max to 64x
   * Show domain CPU weight and cap if available
   * Fix typos in xen_cpu script for XenAPI code
   * Bump theoretical CPU max to 64x
   * Show domain CPU weight and cap if available
+  * Refuse to run with the untested SERVER_XEN_API until we support it elsewhere
 
   [ Evan Broder ]
   * Move the unnecessary Pre-Depends to a Depends
   * We don't need to remove the code from sudoers in the postinst - the
     preinst will get run on upgrade
 
 
   [ Evan Broder ]
   * Move the unnecessary Pre-Depends to a Depends
   * We don't need to remove the code from sudoers in the postinst - the
     preinst will get run on upgrade
 
- -- Evan Broder <broder@mit.edu>  Tue, 25 Nov 2008 23:14:07 -0500
+ -- Quentin Smith <quentin@mit.edu>  Tue, 25 Nov 2008 23:44:22 -0500
 
 xvm-munin-config (0.0.4) unstable; urgency=low
 
 
 xvm-munin-config (0.0.4) unstable; urgency=low
 
index 755c476..2efffe4 100755 (executable)
@@ -3,9 +3,14 @@
 from xen.xm.main import SERVER_LEGACY_XMLRPC, SERVER_XEN_API, parseServer, parseAuthentication
 from xen.xend import sxp
 import atexit
 from xen.xm.main import SERVER_LEGACY_XMLRPC, SERVER_XEN_API, parseServer, parseAuthentication
 from xen.xend import sxp
 import atexit
+import sys
 
 serverType, serverURI = parseServer()
 
 
 serverType, serverURI = parseServer()
 
+if serverType != SERVER_LEGACY_XMLRPC:
+    print >>sys.stderr, "xen_cpu is untested with this Xen server type"
+    sys.exit(1)
+
 if serverType == SERVER_XEN_API:
     from xen.xm import XenAPI
     server = XenAPI.Session(serverURI)
 if serverType == SERVER_XEN_API:
     from xen.xm import XenAPI
     server = XenAPI.Session(serverURI)
@@ -21,8 +26,6 @@ else:
     from xen.util.xmlrpcclient import ServerProxy
     server = ServerProxy(serverURI)
 
     from xen.util.xmlrpcclient import ServerProxy
     server = ServerProxy(serverURI)
 
-import sys
-
 if len(sys.argv) > 1:
     cmd = sys.argv[1]
 else:
 if len(sys.argv) > 1:
     cmd = sys.argv[1]
 else: