Add the bind-address option to ganeti-rapi
authorGuido Trotter <ultrotter@google.com>
Thu, 23 Jul 2009 07:48:14 +0000 (08:48 +0100)
committerGuido Trotter <ultrotter@google.com>
Thu, 23 Jul 2009 08:39:46 +0000 (09:39 +0100)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

daemons/ganeti-rapi

index 7b9710a..f11e66d 100755 (executable)
@@ -206,6 +206,9 @@ def ParseOptions():
   parser.add_option("-f", "--foreground", dest="fork",
                     help="Don't detach from the current terminal",
                     default=True, action="store_false")
+  parser.add_option("-b", "--bind", dest="bind_address",
+                     help="Bind address",
+                     default="", metavar="ADDRESS")
 
   options, args = parser.parse_args()
 
@@ -252,7 +255,7 @@ def main():
   utils.WritePidFile(constants.RAPI_PID)
   try:
     mainloop = daemon.Mainloop()
-    server = RemoteApiHttpServer(mainloop, "", options.port,
+    server = RemoteApiHttpServer(mainloop, options.bind_address, options.port,
                                  ssl_params=ssl_params, ssl_verify_peer=False,
                                  request_executor_class=
                                  JsonErrorRequestExecutor)