From 821312a785697f0beab750db854bb1f6595ab0df Mon Sep 17 00:00:00 2001 From: Andy Bavier Date: Mon, 7 Mar 2011 16:59:20 -0500 Subject: [PATCH] Fix "permission denied to modify tag" error The SFA should give an "Invalid RSpec: permission denied to modify tag" error when the user tries to modify a tag without the proper role. This fix prevents the error being generated when the tag value has not been changed. --- sfa/plc/network.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sfa/plc/network.py b/sfa/plc/network.py index 2a3e6ba2..d8f0c1dd 100644 --- a/sfa/plc/network.py +++ b/sfa/plc/network.py @@ -183,10 +183,14 @@ class Slice: # Update a slice tag if it exists, else add it def update_tag(self, tagname, value, node = None, role = "user"): + tag = self.get_tag(tagname, node) + if tag and tag.value == value: + return tag + tt = self.network.lookupTagType(tagname) if not tt.permit_update(role): raise InvalidRSpec("permission denied to modify '%s' tag" % tagname) - tag = self.get_tag(tagname, node) + if tag: tag.change(value) else: -- 2.47.0