Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in AcmClient with ram_role_name as auth #16

Open
jankozuchowski opened this issue Aug 14, 2021 · 0 comments
Open

Bug in AcmClient with ram_role_name as auth #16

jankozuchowski opened this issue Aug 14, 2021 · 0 comments

Comments

@jankozuchowski
Copy link

jankozuchowski commented Aug 14, 2021

When I'm trying to do following:

import acm

ENDPOINT = ''
NAMESPACE = ''
RAM_ROLE = ''
DATA_ID = ''
GROUP = ''

c = acm.ACMClient(ENDPOINT, NAMESPACE, AK, SK)
c.set_options(kms_enabled=True, region_id="cn-beijing")
print(c.get(DATA_ID, GROUP))

I get following error:

    print(c.get(DATA_ID, GROUP))
  File "/usr/local/lib/python3.8/dist-packages/acm/client.py", line 397, in get
    return self.decrypt(content)
  File "/usr/local/lib/python3.8/dist-packages/acm/client.py", line 897, in decrypt
    resp = json.loads(self.kms_client.do_action_with_exception(req).decode("utf8"))
  File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/client.py", line 473, in do_action_with_exception
    status, headers, body, exception = self._implementation_of_do_action(acs_request)
  File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/client.py", line 308, in _implementation_of_do_action
    return self._handle_retry_and_timeout(endpoint, request, signer)
  File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/client.py", line 376, in _handle_retry_and_timeout
    status, headers, body, exception = self._handle_single_request(endpoint,
  File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/client.py", line 398, in _handle_single_request
    http_response = self._make_http_response(endpoint, request, read_timeout, connect_timeout,
  File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/client.py", line 264, in _make_http_response
    header, url = signer.sign(self._region_id, request)
  File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/auth/signers/ecs_ram_role_signer.py", line 42, in sign
    self._check_session_credential()
  File "/usr/local/lib/python3.8/dist-packages/acm/client.py", line 74, in _check_session_credential_patch
    expiration = self._expiration if isinstance(self._expiration, (float, int)) \
AttributeError: 'EcsRamRoleSigner' object has no attribute '_expiration'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant