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

Fix json-cfg syntax #175

Merged
merged 1 commit into from
Mar 15, 2021
Merged

Conversation

RyanJarv
Copy link
Contributor

This fixes the syntax for json-cfg when running --aws-managed-policies and --auth-details-file

Before this commit you would get an error similar to the following:

    jsoncfg.config_classes.JSONConfigNodeTypeError: Expected a ConfigJSONObject but found
    ConfigJSONScalar. You are trying to access the __contains__ magic method of a scalar
    config object.

It seems that instead of treating the json-cfg objects as hash's you're supposed to access keys
via attributes and use a method call when you want to convert it back into it's original form.

Passing an argument to this method call sets the default return, acting similar to:

    obj.get('key', default)

This fixes the syntax for json-cfg when running --aws-managed-policies and --auth-details-file

Before this commit you would get an error similar to the following:

        jsoncfg.config_classes.JSONConfigNodeTypeError: Expected a ConfigJSONObject but found
        ConfigJSONScalar. You are trying to access the __contains__ magic method of a scalar
        config object.

It seems that instead of treating the json-cfg objects as hash's you're supposed to access keys
via attributes and use a method call when you want to convert it back into it's original form.

Passing an argument to this method call sets the default return, acting similar to:

        obj.get('key', default)
@CLAassistant
Copy link

CLAassistant commented Feb 26, 2021

CLA assistant check
All committers have signed the CLA.

@0xdabbad00
Copy link
Collaborator

LGTM, thank you @RyanJarv.

This is ready to merge @steiza

@steiza steiza merged commit cedc284 into duo-labs:main Mar 15, 2021
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

Successfully merging this pull request may close these issues.

None yet

4 participants