From 74a646939836a183f00ea029c396df84173ca6c0 Mon Sep 17 00:00:00 2001
From: Mark Huang <mlhuang@cs.princeton.edu>
Date: Fri, 20 Oct 2006 18:16:10 +0000
Subject: [PATCH] - search by ip

---
 PLC/Methods/DeleteNodeNetwork.py | 6 +++---
 PLC/Methods/GetNodeNetworks.py   | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/PLC/Methods/DeleteNodeNetwork.py b/PLC/Methods/DeleteNodeNetwork.py
index 7b546de7..47910e30 100644
--- a/PLC/Methods/DeleteNodeNetwork.py
+++ b/PLC/Methods/DeleteNodeNetwork.py
@@ -21,14 +21,14 @@ class DeleteNodeNetwork(Method):
     accepts = [
         PasswordAuth(),
 	Mixed(NodeNetwork.fields['nodenetwork_id'],
-	      NodeNetwork.fields['hostname'])
+	      NodeNetwork.fields['ip'])
         ]
 
     returns = Parameter(int, '1 if successful')
 
-    def call(self, auth, nodenetwork_id_or_hostname):
+    def call(self, auth, nodenetwork_id_or_ip):
         # Get node network information
-        nodenetworks = NodeNetworks(self.api, [nodenetwork_id_or_hostname]).values()
+        nodenetworks = NodeNetworks(self.api, [nodenetwork_id_or_ip]).values()
         if not nodenetworks:
             raise PLCInvalidArgument, "No such node network"
 	nodenetwork = nodenetworks[0]
diff --git a/PLC/Methods/GetNodeNetworks.py b/PLC/Methods/GetNodeNetworks.py
index 1bc6ef24..9d0b4df2 100644
--- a/PLC/Methods/GetNodeNetworks.py
+++ b/PLC/Methods/GetNodeNetworks.py
@@ -7,7 +7,7 @@ from PLC.Auth import PasswordAuth
 class GetNodeNetworks(Method):
     """
     Return an array of structs contain details about node network
-    interfaces. If nodenetwork_id_or_hostname_list is specified, only
+    interfaces. If nodenetwork_id_or_ip_list is specified, only
     the specified node network interfaces will be queried.
     """
 
@@ -16,13 +16,13 @@ class GetNodeNetworks(Method):
     accepts = [
         PasswordAuth(),
         [Mixed(NodeNetwork.fields['nodenetwork_id'],
-               NodeNetwork.fields['hostname'])]
+               NodeNetwork.fields['ip'])]
         ]
 
     returns = [NodeNetwork.fields]
 
-    def call(self, auth, nodenetwork_id_or_hostname_list = None):
-        nodenetworks = NodeNetworks(self.api, nodenetwork_id_or_hostname_list).values()
+    def call(self, auth, nodenetwork_id_or_ip_list = None):
+        nodenetworks = NodeNetworks(self.api, nodenetwork_id_or_ip_list).values()
 
         # Cast from NodeNetwork to real dict
         nodenetworks = [dict(nodenetwork) for nodenetwork in nodenetworks]
-- 
2.47.0