juju / python-libjuju

Python library for the Juju API
Apache License 2.0
59 stars 98 forks source link

[Feature]: Changes in the upstream facade functions should be reported well #793

Open cderici opened 1 year ago

cderici commented 1 year ago

Description

Right now pylibjuju doesn't have a good way of reporting that something has changed in the facade schema from juju. For instance, the in one of the nightly edge builds we see this error message:

________________ test_wait_for_idle_with_exact_units_scale_down ________________
[gw0] linux -- Python 3.10.9 /home/runner/work/python-libjuju/python-libjuju/.tox/py3/bin/python
Traceback (most recent call last):
  File "/home/runner/work/python-libjuju/python-libjuju/tests/integration/test_model.py", line 854, in test_wait_for_idle_with_exact_units_scale_down
    await app.destroy_units(*two_units_to_remove)
  File "/home/runner/work/python-libjuju/python-libjuju/juju/application.py", line 219, in destroy_unit
    return await self.model.destroy_units(*unit_names)
  File "/home/runner/work/python-libjuju/python-libjuju/juju/model.py", line 2120, in destroy_unit
    return await app_facade.DestroyUnits(unit_names=list(unit_names))
  File "/home/runner/work/python-libjuju/python-libjuju/juju/client/facade.py", line 481, in wrapper
    reply = await f(*args, **kwargs)
  File "/home/runner/work/python-libjuju/python-libjuju/juju/client/_client15.py", line 1266, in DestroyUnits
    reply = await self.rpc(msg)
  File "/home/runner/work/python-libjuju/python-libjuju/juju/client/facade.py", line 654, in rpc
    result = await self.connection.rpc(msg, encoder=TypeEncoder)
  File "/home/runner/work/python-libjuju/python-libjuju/juju/client/connection.py", line 638, in rpc
    raise errors.JujuAPIError(result)
juju.errors.JujuAPIError: no such request - method Application(15).DestroyUnits is not implemented

This needs to be caught early and more useful error needs to be raised.

Urgency

Casually wishlisting

Code I'd Like to Run

That whole mess above is trying to say that 

The function `DestroyUnits` from `Application` Facade `v15` that we have been using was removed from Juju API. 
The pylibjuju code needs to be adapted and the schema and the clients need to be updated.
github-actions[bot] commented 1 year ago

This issue is marked as incomplete because it has been open 30 days with no activity. Please remove incomplete label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 months ago

This issue is marked as incomplete because it has been open 30 days with no activity. Please remove incomplete label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 5 days with no activity.

hmlanigan commented 3 weeks ago

Closed prematurely by the bot.