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
- subclass correct class
[plcapi.git]
/
PLC
/
Methods
/
DeleteNodeNetwork.py
diff --git
a/PLC/Methods/DeleteNodeNetwork.py
b/PLC/Methods/DeleteNodeNetwork.py
index
05463df
..
6cba6a6
100644
(file)
--- a/
PLC/Methods/DeleteNodeNetwork.py
+++ b/
PLC/Methods/DeleteNodeNetwork.py
@@
-7,11
+7,10
@@
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
class DeleteNodeNetwork(Method):
"""
class DeleteNodeNetwork(Method):
"""
- Delete an existing Node Network. Nodenetwork_id must be associated to
- node_id and not be associated with a different node.
+ Deletes an existing node network interface.
- ins may delete any node network. PIs and techs can only delete
- node
networks for thier nod
es.
+ Admins may delete any node network. PIs and techs may only delete
+ node
network interfaces associated with nodes at their sit
es.
Returns 1 if successful, faults otherwise.
"""
Returns 1 if successful, faults otherwise.
"""
@@
-20,15
+19,16
@@
class DeleteNodeNetwork(Method):
accepts = [
Auth(),
accepts = [
Auth(),
- Mixed(NodeNetwork.fields['nodenetwork_id'],
- NodeNetwork.fields['ip'])
+ NodeNetwork.fields['nodenetwork_id']
]
returns = Parameter(int, '1 if successful')
]
returns = Parameter(int, '1 if successful')
- def call(self, auth, nodenetwork_id_or_ip):
+
+ def call(self, auth, nodenetwork_id):
+
# Get node network information
# Get node network information
- nodenetworks = NodeNetworks(self.api, [nodenetwork_id
_or_ip
])
+ nodenetworks = NodeNetworks(self.api, [nodenetwork_id])
if not nodenetworks:
raise PLCInvalidArgument, "No such node network"
nodenetwork = nodenetworks[0]
if not nodenetworks:
raise PLCInvalidArgument, "No such node network"
nodenetwork = nodenetworks[0]
@@
-50,4
+50,8
@@
class DeleteNodeNetwork(Method):
nodenetwork.delete()
nodenetwork.delete()
+ # Logging variables
+ self.object_ids = [nodenetwork['nodenetwork_id']]
+ self.message = "Node network %d deleted" % nodenetwork['nodenetwork_id']
+
return 1
return 1