Comment 0 for bug 2046364

Revision history for this message
Peter Jose De Sousa (pjds) wrote :

Hello

[problem]

When setting availabilty on the cinder-csi charm - I hit the following error:

AttributeError: 'NoneType' object has no attribute 'availability'

Full trace:

unit-cinder-csi-1: 16:50:27 ERROR unit.cinder-csi/1.juju-log kube-control:16: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/./src/charm.py", line 231, in <module>
    main(CinderCSICharm)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/main.py", line 438, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/main.py", line 150, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/framework.py", line 355, in emit
    framework._emit(event) # noqa
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/framework.py", line 856, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/framework.py", line 931, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/./src/charm.py", line 195, in _merge_config
    if self._install_or_upgrade(event, config_hash=new_hash):
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/./src/charm.py", line 208, in _install_or_upgrade
    controller.apply_manifests()
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/manifests/manifest.py", line 298, in apply_manifests
    self.apply_resources(*self.resources)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/manifests/manifest.py", line 160, in resources
    additions: List[AnyResource] = list(
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/manifests/manifest.py", line 164, in <genexpr>
    manipulate()
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/src/storage_manifests.py", line 71, in __call__
    sc.parameters.availability = az
AttributeError: 'NoneType' object has no attribute 'availability'

[workaround]

Create the storage class manually with appropriate availability zone

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: csi-sc-cinderplugin
provisioner: cinder.csi.openstack.org
parameters:
  availability: "nova"

Thanks,
Peter