Change in vdsm[master]: [WIP]misc clean for supervdsmServer

lvroyce at linux.vnet.ibm.com lvroyce at linux.vnet.ibm.com
Sun Jan 20 05:23:35 UTC 2013


Royce Lv has uploaded a new change for review.

Change subject: [WIP]misc clean for supervdsmServer
......................................................................

[WIP]misc clean for supervdsmServer

Change-Id: I6a0cf4be2fc2637df36e2abc4a82ddc1a55f72cd
Signed-off-by: Royce Lv<lvroyce at linux.vnet.ibm.com>
---
M vdsm/supervdsmServer.py
1 file changed, 3 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/11196/1

diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index 6cc7725..e0f7ab2 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -44,7 +44,7 @@
 from supervdsm import _SuperVdsmManager
 from storage.fileUtils import chown, resolveGid, resolveUid
 from storage.fileUtils import validateAccess as _validateAccess
-from vdsm.constants import METADATA_GROUP, EXT_UDEVADM, \
+from vdsm.constants import METADATA_USER, METADATA_GROUP, EXT_UDEVADM, \
     DISKIMAGE_USER, DISKIMAGE_GROUP, P_LIBVIRT_VMCHANNELS, P_VDSM_RUN
 from storage.devicemapper import _removeMapping, _getPathsStatus
 import configNetwork
@@ -336,7 +336,6 @@
     def __udevOperationReload(self):
         return self.__udevVersion() > self.UDEV_WITH_RELOAD_VERSION
 
-
 def initLogger():
     try:
         logging.config.fileConfig(LOG_CONF_PATH)
@@ -368,32 +367,14 @@
                     'gluster%s%s' % (name[0].upper(), name[1:]),
                     logDecorator(bind(func)))
 
-    try:
-        logging.config.fileConfig(LOG_CONF_PATH)
-    except:
-        logging.basicConfig(filename='/dev/stdout', filemode='w+',
-                            level=logging.DEBUG)
-        log = logging.getLogger("SuperVdsm.Server")
-        log.warn("Could not init proper logging", exc_info=True)
 
-    log = logging.getLogger("SuperVdsm.Server")
     signal.signal(signal.SIGTERM, sigtermHandler)
 
     try:
+        log = initLogger()
         log.debug("Making sure I'm root")
         if os.geteuid() != 0:
             sys.exit(errno.EPERM)
-
-        log.debug("Parsing cmd args")
-        authkey, parentPid, pidfile, timestamp, address, uid = sys.argv[1:]
-
-        log.debug("Creating PID and TIMESTAMP files: %s, %s",
-                  pidfile, timestamp)
-        spid = os.getpid()
-        with open(pidfile, "w") as f:
-            f.write(str(spid) + "\n")
-        with open(timestamp, "w") as f:
-            f.write(str(misc.getProcCtime(spid) + "\n"))
 
         log.debug("Cleaning old socket %s", address)
         if os.path.exists(address):
@@ -411,8 +392,7 @@
             servThread.setDaemon(True)
             servThread.start()
 
-            for f in (address, timestamp, pidfile):
-                chown(f, int(uid), METADATA_GROUP)
+            chown(address, METADATA_USER, METADATA_GROUP)
 
             log.debug("Started serving super vdsm object")
 


--
To view, visit http://gerrit.ovirt.org/11196
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a0cf4be2fc2637df36e2abc4a82ddc1a55f72cd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce at linux.vnet.ibm.com>


More information about the vdsm-patches mailing list