X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FUpdateInterfaceTag.py;h=5370f7de0639c24b11fe0fe8d9692a9fda95c162;hb=d0c553e8b3a7191514d56cb312552f325c67db90;hp=1d52ea3f711f7e1f08e28986a22baf3d7cf066cb;hpb=02fbeb3d8ae6da8ed1ce4c83ec64fa174906c5f7;p=plcapi.git diff --git a/PLC/Methods/UpdateInterfaceTag.py b/PLC/Methods/UpdateInterfaceTag.py index 1d52ea3..5370f7d 100644 --- a/PLC/Methods/UpdateInterfaceTag.py +++ b/PLC/Methods/UpdateInterfaceTag.py @@ -41,7 +41,11 @@ class UpdateInterfaceTag(Method): tag_type_id = interface_tag['tag_type_id'] tag_type = TagTypes (self.api,[tag_type_id])[0] - interface = Interfaces (self.api, interface_tag['interface_id']) + + interfaces = Interfaces (self.api, interface_tag['interface_id']) + if not interfaces: + raise PLCInvalidArgument, "No such interface %d"%interface_tag['interface_id'] + interface=interfaces[0] # check authorizations if 'admin' in self.caller['roles']: