applied changeset 9676 on trunk
[nodemanager.git] / net.py
diff --git a/net.py b/net.py
index b0874a6..2bd220c 100644 (file)
--- a/net.py
+++ b/net.py
@@ -1,4 +1,5 @@
 #
+# $Id$
 #
 """network configuration"""
 
@@ -59,7 +60,7 @@ def InitI2(plc, data):
         logger.log("This is an Internet2 node.  Setting rules.")
         i2nodes = []
         i2nodeids = plc.GetNodeGroups(["Internet2"])[0]['node_ids']
-        for node in plc.GetNodeNetworks({"node_id": i2nodeids}, ["ip"]):
+        for node in plc.GetInterfaces({"node_id": i2nodeids}, ["ip"]):
             i2nodes.append(node['ip'])
         bwlimit.exempt_init('Internet2', i2nodes)
 
@@ -84,19 +85,19 @@ def InitNAT(plc, data):
             continue
 
         try:
-            settings = plc.GetNodeNetworkSettings({'nodenetwork_setting_id': network['nodenetwork_setting_ids']})
+            settings = plc.GetInterfaceSettings({'interface_setting_id': network['interface_setting_ids']})
         except:
             continue
         # XXX arbitrary names
         for setting in settings:
-            if setting['category'] != 'firewall':
+            if setting['category'].upper() != 'FIREWALL':
                 continue
-            if setting['name'] == 'external':
+            if setting['name'].upper() == 'EXTERNAL':
                 # Enable NAT for this interface
                 ipt.add_ext(dev)
-            elif setting['name'] == 'internal':
+            elif setting['name'].upper() == 'INTERNAL':
                 ipt.add_int(dev)
-            elif setting['name'] == 'pf': # XXX Uglier code is hard to find...
+            elif setting['name'].upper() == 'PF': # XXX Uglier code is hard to find...
                 for pf in setting['value'].split("\n"):
                     fields = {}
                     for field in pf.split(","):