Missing check on manage_lbs causes charm to error if lb relation comes before juju trust command

Bug #1937300 reported by Pedro Guimarães
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Azure Integrator Charm
New
Undecided
Unassigned

Bug Description

When deploying and sharing credentials with juju trust, I've noticed that we have no checks for manage_lbs() method as we have for handle_requests().

That may cause the following error at the begining of the deployment:
2021-07-22 16:40:24 ERROR juju-log lb-consumers:1: Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.8/site-packages/charms/reactive/__init__.py", line 74, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-azure-integrator-0/charm/reactive/azure.py", line 100, in manage_lbs
    _create_lb(request)
  File "/var/lib/juju/agents/unit-azure-integrator-0/charm/reactive/azure.py", line 112, in _create_lb
    request.response.address = layer.azure.create_loadbalancer(request)
  File "/var/lib/juju/agents/unit-azure-integrator-0/charm/lib/charms/layer/azure.py", line 325, in create_loadbalancer
    _azure("network", *lb_create_args)
  File "/var/lib/juju/agents/unit-azure-integrator-0/charm/lib/charms/layer/azure.py", line 733, in _azure
    raise AzureError.get(stderr)
charms.layer.azure.AzureError: ERROR: Please run 'az login' to setup account.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.