-
Notifications
You must be signed in to change notification settings - Fork 813
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
[flare] Remove proxy credentials from collected datadog.conf #1942
Conversation
@JohnLZeller can you review this one ? |
This needs to be rebased |
2045510
to
e4a3a2f
Compare
I've rebased and refactored this PR, and also changed a little bit the output of flare when credentials are removed, it looks like this now:
|
+ some refactoring on the credentials removal
e4a3a2f
to
5b14cb9
Compare
def _strip_password(self, file_path): | ||
# Return path to a temp file without comments on which the credential patterns have been applied | ||
def _strip_credentials(self, file_path, credential_patterns=None): | ||
if not credential_patterns: |
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.
Could just use credential_patterns=[]
in the function definition, instead.
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.
In Python I prefer avoiding using mutable objects as default parameter values because of this: http://effbot.org/zone/default-values.htm
It can be pretty annoying to debug this kind of behaviors...
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.
Bah mutable, my mistake! Carry on...
LGTM after those comments :) 👍 |
Everything is g2g |
Thanks @JohnLZeller! :) |
[flare] Remove proxy credentials from collected datadog.conf
Also added a message in the output to make credentials removal from
datadog.conf
explicit. The message is similar to what is already displayed for the yaml files inconf.d
, for instance: