Move RAPI constants to ganeti.constants
authorOleksiy Mishchenko <oleksiy@google.com>
Mon, 21 Apr 2008 10:20:56 +0000 (10:20 +0000)
committerOleksiy Mishchenko <oleksiy@google.com>
Mon, 21 Apr 2008 10:20:56 +0000 (10:20 +0000)
Reviewed-by: iustinp

daemons/ganeti-rapi
lib/constants.py

index 834c957..3a02a7e 100755 (executable)
@@ -30,9 +30,6 @@ from ganeti import constants
 from ganeti import utils
 from ganeti.rapi import RESTHTTPServer
 
-RELEASE_VERSION = 0.01
-API_PORT = 5080
-
 
 def ParseOptions():
   """Parse the command line options.
@@ -43,14 +40,15 @@ def ParseOptions():
   """
   parser = optparse.OptionParser(description="Ganeti Remote API",
                     usage="%prog [-d] [-p port]",
-                    version="%%prog (ganeti) %s" % RELEASE_VERSION)
-
+                    version="%%prog (ganeti) %s" %
+                                 constants.RAPI_VERSION)
   parser.add_option("-d", "--debug", dest="debug",
                     help="Enable some debug messages",
                     default=False, action="store_true")
   parser.add_option("-p", "--port", dest="port",
-                    help="Port to run API",
-                    default=API_PORT, type="int")
+                    help="Port to run API (%s default)." %
+                                 constants.RAPI_PORT,
+                    default=constants.RAPI_PORT, type="int")
   parser.add_option("-S", "--https", dest="ssl",
                     help="Secure HTTP protocol with SSL",
                     default=False, action="store_true")
index c46ec5b..5f6232c 100644 (file)
@@ -29,6 +29,7 @@ PROTOCOL_VERSION = 11
 RELEASE_VERSION = _autoconf.PACKAGE_VERSION
 OS_API_VERSION = 5
 EXPORT_VERSION = 0
+RAPI_VERSION = 1
 
 
 # file paths
@@ -174,3 +175,6 @@ IALLOCATOR_DIR_OUT = "out"
 IALLOCATOR_MODE_ALLOC = "allocate"
 IALLOCATOR_MODE_RELOC = "relocate"
 IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH
+
+# Remote API constants
+RAPI_PORT = 5080