bugfix dummynet-4.2-2 dummynet-4.2-2
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 24 Apr 2008 07:48:40 +0000 (07:48 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 24 Apr 2008 07:48:40 +0000 (07:48 +0000)
PLC/Methods/GetBootMedium.py

index 94651b7..202614d 100644 (file)
@@ -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: