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
Update: enable OS_DEBUG #1246
Update: enable OS_DEBUG #1246
Conversation
Build succeeded.
|
openstack/provider.go
Outdated
@@ -403,6 +406,13 @@ func Provider() terraform.ResourceProvider { | |||
return configureProvider(d, terraformVersion) | |||
} | |||
|
|||
// enforce OS_DEBUG when TF_LOG is 'DEBUG' or 'TRACE' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is nice but I don't like the implementation when we rewrite some environment variables in the system to change the behaviour of the gophercloud/utils
library.
I think that we need to configure logger
in that library when we have DEBUG
or TRACE
loglevel.
https://github.com/gophercloud/utils/blob/master/terraform/auth/config.go#L182
There should be a way to configure it. Or maybe we need a PR to gophercloud/utils
to configure logger (or using &osClient.DefaultLogger{}
programmatically, without dealing with env variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't think I was "rewriting" it as I am setting it when it's not set. But I'll have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ozerovandrei I made a PR over there: gophercloud/utils#153 — is this what you were thinking? I am not sure what the release cycle is, but I can re-work this PR when there is a release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ozerovandrei Can I just update the dependency in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, you can update the dependency here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ozerovandrei reworked my approach, rebased and then also updated gophercloud/utils
with go get github.com/gophercloud/utils@latest
. Can you have a look again?
Hopefully didn't change much and kept all BC. The idea is to allow the terraform openstack provider to enable logging using the configuration struct, vs. using environment variables. Related: terraform-provider-openstack/terraform-provider-openstack#1246
Hopefully didn't change much and kept all BC. The idea is to allow the terraform openstack provider to enable logging using the configuration struct, vs. using environment variables. Related: terraform-provider-openstack/terraform-provider-openstack#1246
Build failed.
|
On both builds,
Probably (hopefully) not related. I had a look though: I can't tell exactly where it fails, so there is a |
@till this is really a nice feature. |
@frittentheke yes, will do — I hope I get to it all by Friday or earlier. Maybe during the ⚽ game tonight. :D |
048a90a
to
8e8ecc7
Compare
@frittentheke @ozerovandrei hope I addressed everything. Let me know! |
Can anyone take a look? 👀 |
Sorry @till for picking this up just now and thanks for keeping at it! I built and tested the provider and things work just as expected. But you are lacking the change to go.mod (bumping the dependency to github.com/gophercloud/utils containing your MR gophercloud/utils#153) ... I pulled in latest and it should look like this:
|
@frittentheke Sorry, probably screwed up my rebase. Will fix. |
- when TF_LOG is debug/trace (and OS_DEBUG is not set) - enable this by default (person probably wants it) Resolves: terraform-provider-openstack#1203
@frittentheke I tried my best to rebase it again. Can you or anyone else see if this can get integrated soon? Otherwise, feel free to pick the commits from my fork. I am also happy if this lands in the official code and I can stop patching it. :) |
Build failed.
|
@ozerovandrei could you kindly take an other look at this. I quite like the change and usually do exactly that manually anyways. |
@ozerovandrei sorry to bug, but can you take a look this week? Or is there someone else who can? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thank you @till
Thanks very much! |
Resolves: #1203