outscale / osc-sdk-python

Python SDK to perform actions on Outscale API.
BSD 3-Clause "New" or "Revised" License
6 stars 9 forks source link

Action AddUserToUserGroup does not exists #135

Closed hoangnq closed 4 months ago

hoangnq commented 4 months ago

Bonjour

L'API en question est bien documentée https://docs.outscale.com/api.html?python#addusertousergroup , mais inutilisable.

===== Code:

result = gw.AddUserToUserGroup( UserGroupName="admin", UserGroupPath="/", UserName="cloudext.admin.iac", UserPath="/", ) print(result)

===== Erreur:

Traceback (most recent call last): File "/usr/lib64/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/adbdfexp.private/i21390j_ot1/git/cloudext-cli/cloudext_python/main/access_keys/test.py", line 5, in result = gw.AddUserToUserGroup( File "/home/adbdfexp.private/i21390j_ot1/venv39/lib64/python3.9/site-packages/osc_sdk_python/outscale_gateway.py", line 180, in action self._check(action_name, **kwargs) File "/home/adbdfexp.private/i21390j_ot1/venv39/lib64/python3.9/site-packages/osc_sdk_python/outscale_gateway.py", line 164, in _check raise ActionNotExists('Action {} does not exists'.format(action_name)) osc_sdk_python.outscale_gateway.ActionNotExists: Action AddUserToUserGroup does not exists

outscale-mgo commented 4 months ago

Hello, I've just tested this and it seems to work. but if you use the osc-sdk-python repository, the repo use osc-api as submodule, which doesn't synchronise automatically with a git pull. If you want to synchronise the submodule you need to do a

git submodule sync
git submodule update

The error you got, is typically the one you get, with an out of sync repository in osc_sdk_python/osc-api

Note that git sync need to be done, as osc-api URL changes in last release.

hoangnq commented 4 months ago

Thank you. After updating to v0.29 it works.