From f2fa7fab52733182f331eef2fab63e5088f5adde Mon Sep 17 00:00:00 2001
From: Marc Fiuczynski <mef@cs.princeton.edu>
Date: Thu, 13 Aug 2009 16:17:15 +0000
Subject: [PATCH] Be a bit more robust to poorly defined codemux attribute
 values

---
 plugins/codemux.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/plugins/codemux.py b/plugins/codemux.py
index 3852aa2..fa5311f 100644
--- a/plugins/codemux.py
+++ b/plugins/codemux.py
@@ -40,8 +40,11 @@ def GetSlivers(data, config, plc = None):
         for attribute in sliver['attributes']:
             if attribute['tagname'] == 'codemux':
                 # add to conf.  Attribute is [host, port]
-                params = {'host': attribute['value'].split(",")[0], 
-                          'port': attribute['value'].split(",")[1]}
+                parts = attribute['value'].split(",")
+                if len(parts)<2:
+                    logger.log("codemux: attribute value (%s) for codemux not separated by comma. Skipping."%attribute['value'])
+                    continue
+                params = {'host': parts[0], 'port': parts[1]}
                 try:
                     # Check to see if sliver is running.  If not, continue
                     if vserver.VServer(sliver['name']).is_running():
-- 
2.47.0