ovs.daemon: Fix bug introduced by "pychecker" warning fixes.
[sliver-openvswitch.git] / python / ovs / daemon.py
index 85db050..5937877 100644 (file)
@@ -141,7 +141,7 @@ def _make_pidfile():
         # This is global to keep Python from garbage-collecting and
         # therefore closing our file after this function exits.  That would
         # unlock the lock for us, and we don't want that.
-        global file
+        global file_handle
 
         file_handle = open(tmpfile, "w")
     except IOError, e:
@@ -503,7 +503,7 @@ def add_args(parser):
             help="Do not chdir to '/'.")
     group.add_argument("--monitor", action="store_true",
             help="Monitor %s process." % ovs.util.PROGRAM_NAME)
-    group.add_argument("--pidfile", nargs="?", default=pidfile,
+    group.add_argument("--pidfile", nargs="?", const=pidfile,
             help="Create pidfile (default %s)." % pidfile)
     group.add_argument("--overwrite-pidfile", action="store_true",
             help="With --pidfile, start even if already running.")