git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- added logging variable 'object_type'
[plcapi.git]
/
PLC
/
Methods
/
UpdateNode.py
diff --git
a/PLC/Methods/UpdateNode.py
b/PLC/Methods/UpdateNode.py
index
9fa5259
..
b82325e
100644
(file)
--- a/
PLC/Methods/UpdateNode.py
+++ b/
PLC/Methods/UpdateNode.py
@@
-32,6
+32,8
@@
class UpdateNode(Method):
returns = Parameter(int, '1 if successful')
returns = Parameter(int, '1 if successful')
+ object_type = 'Node'
+
def call(self, auth, node_id_or_hostname, node_fields):
node_fields = dict(filter(can_update, node_fields.items()))
def call(self, auth, node_id_or_hostname, node_fields):
node_fields = dict(filter(can_update, node_fields.items()))
@@
-44,9
+46,10
@@
class UpdateNode(Method):
nodes = Nodes(self.api, [node_id_or_hostname])
if not nodes:
raise PLCInvalidArgument, "No such node"
nodes = Nodes(self.api, [node_id_or_hostname])
if not nodes:
raise PLCInvalidArgument, "No such node"
-
node = nodes[0]
node = nodes[0]
- PLCCheckLocalNode(node,"UpdateNode")
+
+ if node['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local node"
# Authenticated function
assert self.caller is not None
# Authenticated function
assert self.caller is not None