UMIACS / rgwadmin

Ceph Object Storage Admin API python library bindings.

Home Page:https://rgwadmin.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot get all users when call get_users()

dazhi509 opened this issue · comments

H i, I need to get all users info created by radowsgw-admin, and i find that when i call

from rgwadmin import RGWAdmin

rgw = RGWAdmin(secure=False, access_key='my_access_key', secret_key='my_secret_key', server='my_host')

users = rgw.get_users()
metadata = rgw.get_metadata(metadata_type='user')
print(users)

and get error as:

/usr/bin/python3.6 /opt/Ceph_Manager/SeaBed_project/Radosgw/tests.py
Traceback (most recent call last):
  File "/opt/Ceph_Manager/SeaBed_project/Radosgw/tests.py", line 42, in <module>
    print(rgw.get_metadata(metadata_type='user'))
  File "/usr/local/lib/python3.6/dist-packages/rgwadmin/rgw.py", line 176, in get_metadata
    headers=headers,
  File "/usr/local/lib/python3.6/dist-packages/rgwadmin/rgw.py", line 159, in _request_metadata
    data=data
  File "/usr/local/lib/python3.6/dist-packages/rgwadmin/rgw.py", line 144, in request
    return self._load_request(r)
  File "/usr/local/lib/python3.6/dist-packages/rgwadmin/rgw.py", line 124, in _load_request
    raise e(j)
rgwadmin.exceptions.AccessDenied: {'Code': 'AccessDenied', 'RequestId': 'tx0000000000000000000fe-005c3ef016-76439f-default', 'HostId': '76439f-default-default'}

but it is worked when i use other api such as create_user(), get_user(uid='testuser').
i use python3.6, ubuntu18.04, and rgwadmin==1.2.4

i use a superuser which caps are

                "type": "buckets",
                "perm": "*"
            },
            {
                "type": "metadata",
                "perm": "*"
            },
            {
                "type": "usage",
                "perm": "*"
            },
            {
                "type": "users",
                "perm": "*"
            },
            {
                "type": "zone",
                "perm": "*"
            }

I am unable to reproduce.

Can you provide the full output of radosgw-admin user info --uid=<uid>?

Feel free to obfuscate anything sensitive.

Hi,

Please feel free to reopen if you can provide the output requested above as well as your ceph cluster version for us to look into this more deeply. I'm not able to reproduce at this time.