Change in vdsm[ovirt-3.2]: Searching for both py and pyc file to start super vdsm
ybronhei at redhat.com
ybronhei at redhat.com
Thu Jan 17 07:42:02 UTC 2013
Hello Douglas Schilling Landgraf, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/11133
to review the following change.
Change subject: Searching for both py and pyc file to start super vdsm
......................................................................
Searching for both py and pyc file to start super vdsm
In oVirt Node we don't keep py files.
Change-Id: I36771ce46f5d00ad8befe33569252bdb8cffeaa1
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/10854
Reviewed-by: Douglas Schilling Landgraf <dougsland at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/supervdsm.py
1 file changed, 9 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/11133/1
diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py
index 532d5ac..740a93e 100644
--- a/vdsm/supervdsm.py
+++ b/vdsm/supervdsm.py
@@ -35,19 +35,23 @@
_g_singletonSupervdsmInstance_lock = threading.Lock()
-def __supervdsmServerPath(serverFile):
+def __supervdsmServerPath():
base = os.path.dirname(__file__)
- serverPath = os.path.join(base, serverFile)
- if os.path.exists(serverPath):
- return os.path.abspath(serverPath)
+ # serverFile can be both the py or pyc file. In oVirt node we don't keep
+ # py files. this method looks for one of the two to calculate the absolute
+ # path of supervdsmServer
+ for serverFile in ("supervdsmServer.py", "supervdsmServer.pyc"):
+ serverPath = os.path.join(base, serverFile)
+ if os.path.exists(serverPath):
+ return os.path.abspath(serverPath)
raise RuntimeError("SuperVDSM Server not found")
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("supervdsmServer.py")
+SUPERVDSM = __supervdsmServerPath()
extraPythonPathList = []
--
To view, visit http://gerrit.ovirt.org/11133
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I36771ce46f5d00ad8befe33569252bdb8cffeaa1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
More information about the vdsm-patches
mailing list