Print log only after global vdu semaphore is acquired. Misleading otherwise.
[nodemanager.git] / vsys.py
diff --git a/vsys.py b/vsys.py
index fa49b4b..a2a6b9f 100644 (file)
--- a/vsys.py
+++ b/vsys.py
@@ -36,7 +36,7 @@ def GetSlivers(data):
                     scripts[attribute['value']].append(sliver['name'])
  
     # Write the conf
-    writeConf(slices, parseConf())
+    _restart = writeConf(slices, parseConf()) or _restart
     # Write out the ACLs
     if writeAcls(scripts, parseAcls()) or _restart:
         logger.log("vsys: restarting vsys service")
@@ -61,7 +61,7 @@ def touchAcls():
     for (root, dirs, files) in os.walk(VSYSBKEND):
         for file in files:
             if file.endswith(".acl"):
-                acls.append(file.rstrip(".acl"))
+                acls.append(file.replace(".acl", ""))
             else:
                 scripts.append(file)
     for new in (Set(scripts) - Set(acls)):
@@ -101,7 +101,7 @@ def parseAcls():
         for file in files:
             if file.endswith(".acl"):
                 f = open(root+"/"+file,"r+")
-                scriptname = file.rstrip(".acl")
+                scriptname = file.replace(".acl", "")
                 scriptacls[scriptname] = []
                 for slice in f.readlines():  
                     scriptacls[scriptname].append(slice.rstrip())
@@ -123,6 +123,9 @@ def writeConf(slivers, oldslivers):
             f.write("/vservers/%(name)s/vsys %(name)s\n" % {"name": sliver})
         f.truncate()
         f.close()
+        return True
+    else:
+        return False
 
 
 def parseConf():