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

Getting Error: 'base_template' on otterdog import #247

Closed
cunla opened this issue Jul 11, 2024 · 2 comments
Closed

Getting Error: 'base_template' on otterdog import #247

cunla opened this issue Jul 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@cunla
Copy link

cunla commented Jul 11, 2024

> otterdog import {org} -vvv
Traceback (most recent call last):
  File "/home/style/.local/pipx/venvs/otterdog/lib/python3.10/site-packages/otterdog/cli.py", line 110, in invoke
    _CONFIG = OtterdogConfig.from_file(config_file, local_mode)
  File "/home/style/.local/pipx/venvs/otterdog/lib/python3.10/site-packages/otterdog/config.py", line 302, in from_file
    return cls(config_file, local_mode)
  File "/home/style/.local/pipx/venvs/otterdog/lib/python3.10/site-packages/otterdog/config.py", line 164, in __init__
    org_config = OrganizationConfig.from_dict(org, self)
  File "/home/style/.local/pipx/venvs/otterdog/lib/python3.10/site-packages/otterdog/config.py", line 89, in from_dict
    base_template = data.get("base_template", otterdog_config.default_base_template)
  File "/home/style/.local/pipx/venvs/otterdog/lib/python3.10/site-packages/otterdog/config.py", line 191, in default_base_template
    return self._jsonnet_config["base_template"]
KeyError: 'base_template'
╷
│ Error: 'base_template'
@cunla
Copy link
Author

cunla commented Jul 11, 2024

solved by adding this to config file:

  "defaults":{
    "jsonnet": {
      "base_template": "https://github.com/EclipseFdn/otterdog-defaults#otterdog-defaults.libsonnet@main",
      "config_dir": "orgs"
    }
  },

@netomi
Copy link
Contributor

netomi commented Jul 11, 2024

thanks for testing this out. That should have thrown an error indicating the problem instead of a stacktrace.

will change that accordingly. I assume there are other cases where mandatory settings are not properly checked in advance, as in our operational setup things are already defined. But if other people wanna use it as well they ofc run into such issues.

ty for checking it out.

@netomi netomi closed this as completed in 61e10c0 Jul 11, 2024
@netomi netomi added the bug Something isn't working label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants