From: Oleksiy Mishchenko Date: Mon, 21 Apr 2008 10:20:56 +0000 (+0000) Subject: Move RAPI constants to ganeti.constants X-Git-Tag: v1.2.4~125 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/b8b3adeb95e0ff31ce5284e2fa090bbbff43bfdc Move RAPI constants to ganeti.constants Reviewed-by: iustinp --- diff --git a/daemons/ganeti-rapi b/daemons/ganeti-rapi index 834c957..3a02a7e 100755 --- a/daemons/ganeti-rapi +++ b/daemons/ganeti-rapi @@ -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") diff --git a/lib/constants.py b/lib/constants.py index c46ec5b..5f6232c 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -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