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

get of a nested config property should print a list of items #18

Open
gronke opened this issue Feb 5, 2019 · 0 comments
Open

get of a nested config property should print a list of items #18

gronke opened this issue Feb 5, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@gronke
Copy link
Member

gronke commented Feb 5, 2019

It would be nice to get a bunch of variables when querying a nested BaseConfig property with the ioc get CLI command. Printing multiple values is already supported (see --all), so this enhancement would allow to select an entire namespace in their output.

Nested sub-namespaces are expected to work in the same way.

Current result

$ ioc get provisioning. webirc
The config property 'provisioning.' is unknown
Traceback (most recent call last):
  File "/usr/local/bin/ioc", line 10, in <module>
    sys.dd:exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/src/ioc/ioc_cli/get.py", line 97, in cli
    value = lookup_method(source_resource, _prop)
  File "/usr/local/src/ioc/ioc_cli/get.py", line 131, in _lookup_jail_value
    value = resource.getstring(key)
  File "/usr/local/lib/python3.6/site-packages/libioc/Resource.py", line 356, in getstring
    value = self.get(key)
  File "/usr/local/lib/python3.6/site-packages/libioc/Jail.py", line 229, in get
    return self.jail.config[key]
  File "/usr/local/lib/python3.6/site-packages/libioc/Config/Jail/JailConfig.py", line 86, in __getitem__
    return super().__getitem__(key)
  File "/usr/local/lib/python3.6/site-packages/libioc/Config/Jail/BaseConfig.py", line 571, in __getitem__
    self._require_known_config_property(key)
  File "/usr/local/lib/python3.6/site-packages/libioc/Config/Jail/BaseConfig.py", line 806, in _require_known_config_property
    logger=self.logger
libioc.errors.UnknownConfigProperty
$ ioc get provisioning.source webirc
/usr/local/etc/puppet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant