Whamcloud - gitweb
Branch b1_4
authornathan <nathan>
Tue, 25 Oct 2005 19:37:04 +0000 (19:37 +0000)
committernathan <nathan>
Tue, 25 Oct 2005 19:37:04 +0000 (19:37 +0000)
b=9477
r=adilger
- robustify mtime check
- forgot to add back in part of --service= checks

lustre/utils/lconf

index 3455e81..58a1926 100755 (executable)
@@ -1410,6 +1410,8 @@ class OSD(Module):
             self.active = 1
         else:
             self.active = 0
+        if self.active and config.group and config.group != ost.get_val('group', ost.get_val('name')):
+            self.active = 0
 
         self.target_dev_uuid = self.uuid
         self.uuid = target_uuid
@@ -2056,8 +2058,9 @@ def doCheckMtime(lustreDB, hosts):
             if config.verbose:
                 print "Checking XML modification time"
             devpath = mdsdb.get_val('devpath','')
-            xmtime = string.atof(lustreDB.get_mtime())
+            xmtime = int(lustreDB.get_mtime())
             runcmd("mkdir /tmp/lustre-XXXX/")
+            # mounting ro causes confusing syslog errors 
             if is_block(devpath):
                 ret, out = runcmd("mount %s /tmp/lustre-XXXX/" %devpath)
             else:
@@ -2065,9 +2068,17 @@ def doCheckMtime(lustreDB, hosts):
             if ret:
                 print out[0]
             else:
-                out = os.stat("/tmp/lustre-XXXX/LOGS")
-                kmtime = string.atof(out[8])
+                try:
+                    out = os.stat("/tmp/lustre-XXXX/LOGS")
+                except OSError:
+                    runcmd("umount -f /tmp/lustre-XXXX/")
+                    panic("Warning: Can't read Lustre logs." 
+                          " Please run --write_conf to update.")
                 runcmd("umount -f /tmp/lustre-XXXX/")
+                try:
+                    kmtime = int(out[8])
+                except ValueError:
+                    kmtime = xmtime
                 if xmtime > kmtime :
                     panic("Warning: the startup logs are older than the XML file." 
                           " Please run --write_conf to update.")
@@ -2085,7 +2096,6 @@ def doHost(lustreDB, hosts):
             if config.service:
                 tgt_select[config.service] = h
                 config.group = config.service
-                print "Configure the", config.group, "service on current node."
             break
     if not node_db:
         panic('No host entry found.')