cxorm commented on a change in pull request #94: HDDS-2255. Improve Acl Handler Messages URL: https://github.com/apache/hadoop-ozone/pull/94#discussion_r340429508
########## File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/AddAclKeyHandler.java ########## @@ -91,10 +91,15 @@ public Void call() throws Exception { OzoneObj.StoreType.valueOf(storeType)) .build(); - boolean result = client.getObjectStore().addAcl(obj, + boolean aclExisted = client.getObjectStore().checkAclExist(obj, OzoneAcl.parseAcl(acl)); - - System.out.printf("%s%n", "Acl added successfully: " + result); + if (aclExisted) { + System.out.println("ACL already exists."); + } else { + boolean result = client.getObjectStore().addAcl(obj, Review comment: Thanks @bharatviswa504 Sorry for last comment. I found that ```ozone sh vol setacl --acls=user:newUser:wr,user:newUser:w,user:newUser:r /vol``` will return ```false``` for the already existed acl. ```ozone sh bucket setacl --acls=user:newUser:wr,user:newUser:w,user:newUser:r /vol/buc``` will return ```true``` ```ozone sh key setacl --acls=user:newUser:wr,user:newUser:w,user:newUser:r /vol/buc/ikey``` will return ```true``` So I update the ```SetAclVolumeHandler```. Could we fix the ```SetAclBucketHandler``` &```SetAclKeyHandler``` to show the right message for the existed acl ? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org