From: Thierry Parmentelat Date: Thu, 24 Apr 2008 07:48:40 +0000 (+0000) Subject: bugfix X-Git-Tag: PLCAPI-dummynet-1~3 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f3bb517d1d607a4497a6de0a8334b23655c9fc55;p=plcapi.git bugfix --- diff --git a/PLC/Methods/GetBootMedium.py b/PLC/Methods/GetBootMedium.py index 94651b78..202614d3 100644 --- a/PLC/Methods/GetBootMedium.py +++ b/PLC/Methods/GetBootMedium.py @@ -220,7 +220,7 @@ class GetBootMedium(Method): # see also InstallBootstrapFS in bootmanager that does similar things def get_nodefamily (self, node): try: - (pldistro,arch) = file("/etc/planetlab/nodefamily").read().split("-") + (pldistro,arch) = file("/etc/planetlab/nodefamily").read().strip().split("-") except: (pldistro,arch) = ("planetlab","i386") @@ -249,11 +249,9 @@ class GetBootMedium(Method): def bootcd_version (self): try: - f = open (self.BOOTCDDIR + "/build/version.txt") - version=f.readline().strip() - finally: - f.close() - return version + return file(self.BOOTCDDIR + "/build/version.txt").readline().strip() + except: + raise Exception,"Unknown boot cd version - probably wrong bootcd dir : %s"%self.BOOTCDDIR def cleantrash (self): for file in self.trash: