From 2b43f551b68c6a0b1973b92560c76690972c9d2b Mon Sep 17 00:00:00 2001
From: Marta Carbone <marta@prova.iet.unipi.it>
Date: Thu, 23 Apr 2009 19:30:29 +0000
Subject: [PATCH] Add update on the dummynet key. Fixed a non-typo.

---
 PLC/Methods/GetDummyBoxMedium.py | 7 +++++--
 PLC/Methods/GetDummyBoxUsers.py  | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/PLC/Methods/GetDummyBoxMedium.py b/PLC/Methods/GetDummyBoxMedium.py
index fb5297ef..45665224 100644
--- a/PLC/Methods/GetDummyBoxMedium.py
+++ b/PLC/Methods/GetDummyBoxMedium.py
@@ -156,8 +156,11 @@ class GetDummyBoxMedium(Method):
         os.system("rm %s" % (lockfile))
 
         # if all goes fine store the key in the database
-        dummybox_info['key'] = new_key
-        dummybox_info.sync()
+        nodes = Nodes(self.api, dummybox_id)
+        if not nodes:
+            raise PLCInvalidArgument, "No such node %r"%node_id_or_hostname
+        nodes[0]['key'] = new_key
+        nodes.sync()
 
         # return the file's content base64-encoded
         result = file(IMAGE_NAME).read()
diff --git a/PLC/Methods/GetDummyBoxUsers.py b/PLC/Methods/GetDummyBoxUsers.py
index 24cea9b1..4f5ac3cc 100644
--- a/PLC/Methods/GetDummyBoxUsers.py
+++ b/PLC/Methods/GetDummyBoxUsers.py
@@ -83,7 +83,7 @@ class GetDummyBoxUsers(Method):
 
 		node_list = []
 		for i in connected_nodes:
-			node_list.append(['node_id'])
+			node_list.append(i['node_id'])
 
 		nodes = Nodes(self.api, node_list, ['node_id', 'hostname', 'slice_ids'])
 		if not nodes: return 0
-- 
2.47.0