Browse Source

Use (deprecated) getVersion (getAPIVersion doesnt exist in older supervisors).

Chris McDonough 18 years ago
parent
commit
8b58aedc8a

+ 1 - 1
src/supervisor/supervisorctl.py

@@ -113,7 +113,7 @@ class Controller(cmd.Cmd):
     def _upcheck(self):
         try:
             supervisor = self._get_supervisor()
-            api = supervisor.getAPIVersion()
+            api = supervisor.getVersion() # deprecated
             from supervisor import rpcinterface
             if api != rpcinterface.API_VERSION:
                 self._output(

+ 2 - 0
src/supervisor/tests/base.py

@@ -520,6 +520,8 @@ class DummySupervisorRPCNamespace:
     def getAPIVersion(self):
         return '3.0'
 
+    getVersion = getAPIVersion # deprecated
+
     def readProcessLog(self, name, offset, length):
         from supervisor import xmlrpc
         import xmlrpclib

+ 1 - 1
src/supervisor/tests/test_supervisorctl.py

@@ -25,7 +25,7 @@ class ControllerTests(unittest.TestCase):
 
     def test__upcheck_wrong_server_version(self):
         options = DummyClientOptions()
-        options._server.supervisor.getAPIVersion = lambda *x: '1.0'
+        options._server.supervisor.getVersion = lambda *x: '1.0'
         controller = self._makeOne(options)
         controller.stdout = StringIO()
         result = controller._upcheck()