Skip to content

Optional/hidden configuration fields are actually required by client classes #13

@mikattack

Description

@mikattack

The documentation states:

Since config is a dict, you can also build it manually and check it with config.validate_config()

So I create a simple dictionary similar to this:

{
    "user" = ...,
    "tenancy" = ...,
    "fingerprint" = ...,
    "key_file" = ...,
    "region" = ...
}

That dictionary passes the validate_config() check.

However, when attempting to create a VirtualNetworkClient I get a KeyError for pass_phrase.

After looking at the oraclebmc/config.py and oraclebmc/core/virtual_network_client.py source code, it appears that client code makes the assumption that all configuration dictionaries have these optional fields populated. Configurations loaded with config.from_file() automatically pre-populate these fields. But synthetic ones obviously do not.

The client classes should validate whether these optional values are present in the configuration before assigning them in their constructors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions