filter out addresses not in current cluster
authorScott Baker <smbaker@gmail.com>
Wed, 13 Nov 2013 01:51:44 +0000 (17:51 -0800)
committerScott Baker <smbaker@gmail.com>
Wed, 13 Nov 2013 01:51:44 +0000 (17:51 -0800)
plugins/hostmap.py

index 6a71ec2..8af33cf 100644 (file)
@@ -38,6 +38,8 @@ def GetSlivers(data, config=None, plc=None):
 
     hostname = data['hostname']
 
+    hostname_filter = ".".join(hostname.split(".")[1:])
+
     for sliver in data['slivers']:
         slicename = sliver['name']
         for tag in sliver['attributes']:
@@ -54,6 +56,9 @@ def GetSlivers(data, config=None, plc=None):
                     if len(parts)==2:
                        line = "%s pvt.%s private%d" % (parts[0], parts[1], index)
 
+                       if not (hostname_filter in parts[1]):
+                           continue
+
                        if (index==0):
                            line = line + " headnode"