iscsiinitiators is None by default. We can set ''(empty string) to the config in the bundle, but it's dangerous since if we run the bundle again, then it will reset iscsiinitiators to empty even if it's set by an operator.
unit-cinder-oceanstor-0: 09:17:06 INFO unit.cinder-oceanstor/0.juju-log storage-backend:227: Invoking reactive handler: reactive/cinder_oceanstor_handlers.py:47:render_config
unit-cinder-oceanstor-0: 09:17:06 ERROR unit.cinder-oceanstor/0.juju-log storage-backend:227: Hook error:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-cinder-oceanstor-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-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 390, in dispatch
_invoke(other_handlers)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 359, in _invoke
handler.invoke()
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 181, in invoke
self._action(*args)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/charm/reactive/cinder_oceanstor_handlers.py", line 55, in render_config
charm.render_with_interfaces(args)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms_openstack/charm/core.py", line 994, in render_with_interfaces
self.render_configs(
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms_openstack/charm/core.py", line 975, in render_configs
_render(os.path.basename(conf))
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms_openstack/charm/core.py", line 964, in _render
charmhelpers.core.templating.render(
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charmhelpers/core/templating.py", line 85, in render
content = template.render(context)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/jinja2/asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "templates/cinder_huawei_conf.xml", line 24, in <module>
{% set initiators = options.iscsiinitiators.split(';') %}
jinja2.exceptions.UndefinedError: 'None' has no attribute 'split'
iscsiinitiators is None by default. We can set ''(empty string) to the config in the bundle, but it's dangerous since if we run the bundle again, then it will reset iscsiinitiators to empty even if it's set by an operator.