irods / python-irodsclient

A Python API for iRODS
Other
62 stars 72 forks source link

(in iRODS 4.3.2) an iRODSGroup cannot be removed #539

Closed d-w-moore closed 2 months ago

d-w-moore commented 2 months ago

as of iRODS 4.3.2 (specifically the #7380 fix ) v2.0.0 can no longer remove groups due to the new differentiation required in the user/group parameter, in the rmgroup command:

>>> g = session.groups.create('mygroup')
>>> g.remove()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/lib/irods/python-irodsclient/irods/user.py", line 93, in remove
    self.manager.remove(self.name)
  File "/var/lib/irods/python-irodsclient/irods/manager/user_manager.py", line 103, in remove
    response = conn.recv()
  File "/var/lib/irods/python-irodsclient/irods/connection.py", line 152, in recv
    raise get_exception_by_code(msg.int_info, err_msg)
irods.exception.CAT_INVALID_USER: None

The solution needs to allow session.<MANAGER>.remove(groupName)with<MANAGER> being either users or groups. It should also function for earlier iRODS servers, ie ["rm","group"] is necessary/appropriate in the rsGeneralAdmin rmgroup API for iRODS 4.3.2+, but for iRODS 4.3.1 and previous servers, might cause an error . For the older servers, ["rm","user"] is needed even if the "username" being removed is that of a Group.

alanking commented 2 months ago

@d-w-moore - Please close if complete. Thanks!