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_auth_info in chaosreliably.__init__.py tries to reference a non-existent key #1

Closed
ciaransweet opened this issue Jul 22, 2021 · 0 comments · Fixed by #2
Closed
Assignees
Labels
bug Something isn't working

Comments

@ciaransweet
Copy link
Contributor

When an experiment with a top level entry of:

"secrets": {
  "reliably": {
    "host": "a-host"
  }
}

And action entry of:

"provider": {
    "type": "python",
    "module": "chaosreliably.slo.probes",
    "func": "get_last_N_slos",
    "arguments": {
        "quantity": 1
    },
    "secrets": ["reliably"]
},

Is provided, the get_auth_info function mistakenly tries to do:

reliably_secrets = secrets.get("reliably", {})

This always results in reliably_secrets={} because secrets={"host": "a-host"}.

The block here https://github.com/chaostoolkit-incubator/chaostoolkit-reliably/blob/master/chaosreliably/__init__.py#L81-L83 should instead be:

secrets = secrets or {}
reliably_token = secrets.get("token")
reliably_host = secrets.get("host")
@ciaransweet ciaransweet self-assigned this Jul 22, 2021
@ciaransweet ciaransweet added the bug Something isn't working label Jul 22, 2021
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

Successfully merging a pull request may close this issue.

1 participant