Change in vdsm[master]: [WIP]remove launch and kill svdsm function from supervdsm.py

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


Royce Lv has uploaded a new change for review.

Change subject: [WIP]remove launch and kill svdsm function from supervdsm.py
......................................................................

[WIP]remove launch and kill svdsm function from supervdsm.py

when vdsm lost priviledge, it should not launch and kill priviledged process

Change-Id: Iba310fcd0e82b86b41729dfe7aeeb8fbd56bfaf5
Signed-off-by: Royce Lv<lvroyce at linux.vnet.ibm.com>
---
M Makefile.am
M vdsm/supervdsm.py
2 files changed, 3 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/11194/1

diff --git a/Makefile.am b/Makefile.am
index f0876a8..a0c8667 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,7 +65,8 @@
 
 check-local:
 	find . -path './.git' -prune -type f -o \
-		-name '*.py' -o -name '*.py.in'  | xargs $(PYFLAKES)
+		-name '*.py' ! 'vdsmServer.py' -o \
+		-name '*.py.in'  | xargs $(PYFLAKES)
 	$(PEP8) --exclude="$(PEP8_BLACKLIST)" --filename '*.py,*.py.in' \
 		$(PEP8_WHITELIST)
 	@if test -f .gitignore; then \
diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py
index 0512e30..df0c8a3 100644
--- a/vdsm/supervdsm.py
+++ b/vdsm/supervdsm.py
@@ -51,7 +51,6 @@
 PIDFILE = os.path.join(constants.P_VDSM_RUN, "svdsm.pid")
 TIMESTAMP = os.path.join(constants.P_VDSM_RUN, "svdsm.time")
 ADDRESS = os.path.join(constants.P_VDSM_RUN, "svdsm.sock")
-SUPERVDSM = __supervdsmServerPath()
 
 extraPythonPathList = []
 
@@ -75,7 +74,7 @@
             # don't care that isRunning will run twice
             with self._supervdsmProxy.proxyLock:
                 if not self._supervdsmProxy.isRunning():
-                    self._supervdsmProxy.launch()
+                    self._supervdsmProxy.connect()
 
         try:
             return callMethod()
@@ -110,26 +109,6 @@
 
     def open(self, *args, **kwargs):
         return self._manager.open(*args, **kwargs)
-
-    def _cleanOldFiles(self):
-        self._log.debug("Cleanning svdsm old files: %s, %s, %s",
-                        self.pidfile, self.timestamp, self.address)
-        for f in (self.pidfile, self.timestamp, self.address):
-            utils.rmFile(f)
-
-    def kill(self):
-        try:
-            with open(self.pidfile, "r") as f:
-                pid = int(f.read().strip())
-            misc.execCmd([constants.EXT_KILL, "-9", str(pid)], sudo=True)
-        except Exception:
-            self._log.error("Could not kill old Super Vdsm %s",
-                            exc_info=True)
-
-        self._cleanOldFiles()
-        self._manager = None
-        self._svdsm = None
-        self._firstLaunch = True
 
     def isRunning(self):
         if self._firstLaunch or self._svdsm is None:
@@ -173,11 +152,6 @@
             self._log.warn("Connect to svdsm failed %s", ex)
             raise
         self._svdsm = self._manager.instance()
-
-    def launch(self):
-        self._firstLaunch = False
-        self._start()
-        utils.retry(self._connect, Exception, timeout=60)
 
     def __getattr__(self, name):
         return ProxyCaller(self, name)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba310fcd0e82b86b41729dfe7aeeb8fbd56bfaf5
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