Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$ in aim.conf is interpreted as special character #412

Open
irathore opened this issue Mar 27, 2024 · 0 comments
Open

$ in aim.conf is interpreted as special character #412

irathore opened this issue Mar 27, 2024 · 0 comments
Assignees

Comments

@irathore
Copy link
Contributor

If there is $ in one of the entries e.g.:

In ciscoaci-config.yaml

ACIApicPassword: '$itest$passwd'

Or in aim.conf

apic_password=$itest$passwd

Causes an error. The '$' character has to be escaped like:

ACIApicPassword: ='\$itest\$passwd'

Which results in below in aim.conf

apic_password=\$itest\$passwd

Otherwise this error is seen during aimctl config update

[neutron@overcloud-controller-0 /]$ aimctl config update
Deprecated: Option "rabbit_use_ssl" from group "oslo_messaging_rabbit" is deprecated. Use option "ssl" from group "oslo_messaging_rabbit".
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 3251, in __getitem__
    value = self.conf._get(option, group=group,
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2657, in _get
    value, loc = self._do_get(name, group, namespace)
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2675, in _do_get
    info = self._get_opt_info(name, group)
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2880, in _get_opt_info
    raise NoSuchOptError(opt_name, group)
oslo_config.cfg.NoSuchOptError: no such option i in group [apic]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/aimctl", line 10, in <module>
    sys.exit(aimctl())
  File "/usr/lib/python3.9/site-packages/aim/tools/services/cli.py", line 21, in aimctl
    shell.run()
  File "/usr/lib/python3.9/site-packages/aim/tools/cli/shell.py", line 27, in run
    aim(auto_envvar_prefix='AIM')
  File "/usr/lib/python3.9/site-packages/click/core.py", line 721, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1065, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1065, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.9/site-packages/click/core.py", line 894, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/aim/tools/cli/commands/config.py", line 37, in update
    ctx.obj['manager'].to_db(ctx.obj['conf'], host=host)
  File "/usr/lib/python3.9/site-packages/aim/config.py", line 249, in to_db
    configs = self._to_query_format(cfg_obj, host=host)
  File "/usr/lib/python3.9/site-packages/aim/config.py", line 234, in _to_query_format
    raise e
  File "/usr/lib/python3.9/site-packages/aim/config.py", line 230, in _to_query_format
    value = getattr(getattr(cfg_obj, group), k)
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 3165, in __getattr__
    return self._conf._get(name, self._group)
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2657, in _get
    value, loc = self._do_get(name, group, namespace)
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2720, in _do_get
    return (convert(val), alt_loc)
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2690, in convert
    self._substitute(value, group, namespace), opt)
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2790, in _substitute
    ret = tmpl.safe_substitute(
  File "/usr/lib64/python3.9/string.py", line 142, in safe_substitute
    return self.pattern.sub(convert, self.template)
  File "/usr/lib64/python3.9/string.py", line 133, in convert
    return str(mapping[named])
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 3254, in __getitem__
    value = self.conf._get(key, namespace=self.namespace)
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2657, in _get
    value, loc = self._do_get(name, group, namespace)
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2675, in _do_get
    info = self._get_opt_info(name, group)
  File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2880, in _get_opt_info
    raise NoSuchOptError(opt_name, group)
oslo_config.cfg.NoSuchOptError: no such option i in group [DEFAULT] 
@irathore irathore self-assigned this Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant