Fix updating assigned mano-role breaks permission 73/1573/1
authorPhilip Joseph <philip.joseph@riftio.com>
Mon, 17 Apr 2017 08:36:32 +0000 (08:36 +0000)
committerPhilip Joseph <philip.joseph@riftio.com>
Mon, 17 Apr 2017 08:36:32 +0000 (08:36 +0000)
Change-Id: If4b7a3322c101133014a7ff2c023bc3c94da59ca
Signed-off-by: Philip Joseph <philip.joseph@riftio.com>
rwprojectmano/plugins/rwprojectmano/rift/tasklets/rwprojectmano/rolesmano.py

index 9b0ae00..5550bfd 100644 (file)
@@ -367,25 +367,19 @@ class RoleConfigPublisher(rift.tasklets.DtsConfigPublisher):
         return pbRole
 
     def add_update_role(self, role_key, user_key):
-        update = True
         try:
             role = self.roles[role_key]
         except KeyError:
             role = RoleKeysUsers(role_key)
             self.roles[role_key] = role
-            update = False
 
         try:
             user = role.user(user_key)
         except KeyError:
             user = UserState(user_key)
             role.add_user(user)
-            update = False
 
-        if update:
-            user.state = RoleConfigPublisher.yang_state_str(RoleState.UPDATE)
-        else:
-            user.state = RoleConfigPublisher.yang_state_str(RoleState.NEW)
+        user.state = RoleConfigPublisher.yang_state_str(RoleState.NEW)
 
         xpath = self.role_xpath(role_key)
         self.log.debug("update role: {} user: {} ".format(role_key, user_key))