canonical / canonical/pycloudlib

feature request: completely align toml and class instantiation configuration options

Open
#457 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
22
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Any value that can be configured via the pycloudlib.toml should be able to be passed to the cloud class constructor and vice versa.

The disparity and inconsistency in these options is something that has plague pycloudlib for quite some time. This issue reared its ugly head recently when @Bryzizzle and I were working on https://github.com/canonical/pycloudlib/pull/454.

Also while working on https://github.com/canonical/pycloudlib/pull/454, @Bryzizzle and I realized that the way the required_values works is absolutely ridiculous. if all required values are passed to a class constructor, it will just IGNORE the toml... So if you give the required values at runtime, but have various other config options set in the pycloudlib.toml, it will just ignore the toml file entirely and not read in those other config options.

Similarly, SSH keys can't be passed at runtime to an instance and must either be:
- set in the pycloudlib.toml
- or configured at runtime after the class is instantiated using the `use_key` method.

See https://github.com/canonical/pycloudlib/pull/452 for one of many examples of why this is an awful design paradigm.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.