Timeout curl in the event Apache (PLC side) opens the XMLRPC session, but returns...
[nodemanager.git] / codemux.py
index fa54d4e..7b11350 100644 (file)
@@ -51,8 +51,6 @@ def GetSlivers(data):
                 except:
                     logger.log("codemux:  sliver %s not running yet.  Deferring."\
                                 % sliver['name'])
-
-                    logger.log_exc(name = "codemux")
                     pass
 
     # Remove slices from conf that no longer have the attribute
@@ -68,7 +66,11 @@ def writeConf(slivers, conf = CODEMUXCONF):
     '''Write conf with default entry up top. Elements in [] should have lower order domain names first. Restart service.'''
     f = open(conf, "w")
     # This needs to be the first entry...
-    f.write("* root 1080 %s\n" % Config().PLC_PLANETFLOW_HOST)
+    try: 
+        f.write("* root 1080 %s\n" % Config().PLC_PLANETFLOW_HOST)
+    except AttributeError: 
+        logger.log("codemux:  Can't find PLC_CONFIG_HOST in config. Using PLC_API_HOST")
+        f.write("* root 1080 %s\n" % Config().PLC_API_HOST)
     # Sort items for like domains
     for mapping in slivers:
         for (host, params) in mapping.iteritems():
@@ -102,7 +104,9 @@ def parseConf(conf = CODEMUXCONF):
     try: 
         f = open(conf)
         for line in f.readlines():
-            if line.startswith("#") or (len(line.split()) > 4):
+            if line.startswith("#") \
+            or (len(line.split()) > 4) \
+            or (len(line.split()) < 3):
                 continue
             (host, slice, port) = line.split()[:3]
             logger.log("codemux:  found %s in conf" % slice, 2)