From: Tony Mack Date: Thu, 26 Jul 2007 16:17:27 +0000 (+0000) Subject: - fix typo when raising whitelist exception X-Git-Tag: PLCAPI-4.2-0~97 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f3e7a7ebdc0d73576d4d8d6c6dacbbfcdb73847c;p=plcapi.git - fix typo when raising whitelist exception --- diff --git a/PLC/Methods/AddSliceToNodes.py b/PLC/Methods/AddSliceToNodes.py index e5a60f9..3cfd327 100644 --- a/PLC/Methods/AddSliceToNodes.py +++ b/PLC/Methods/AddSliceToNodes.py @@ -49,6 +49,11 @@ class AddSliceToNodes(Method): # Get specified nodes, add them to the slice nodes = Nodes(self.api, node_id_or_hostname_list) for node in nodes: + # check the slice whitelist on each node first + if node['slice_ids_whitelist'] and \ + slice['slice_id'] not in node['slice_ids_whitelist']: + raise PLCInvalidArgument, "%s is not on %s's whitelist" % \ + (slice['name'], node['hostname']) if slice['slice_id'] not in node['slice_ids']: slice.add_node(node, commit = False)