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

[flare] Log permissions on collected files #1767

Merged
merged 1 commit into from
Jul 13, 2015

Conversation

olivielpeau
Copy link
Member

The permissions are collected in a files_permissions.log file.
All the files are added to the tar through an _add_tar_file method.

The generated files_permissions.log file looks like the following:

File path                                          | mode  | owner      | group
/var/log/datadog/collector.log                     | 0644  | dd-agent   | nogroup
/var/log/datadog/forwarder.log                     | 0644  | dd-agent   | nogroup
/var/log/datadog/dogstatsd.log                     | 0644  | dd-agent   | nogroup
/var/log/datadog/jmxfetch.log                      | 0644  | dd-agent   | nogroup
/var/log/datadog/supervisord.log                   | 0644  | dd-agent   | root
/etc/dd-agent/datadog.conf                         | 0644  | dd-agent   | root
/etc/dd-agent/supervisor.conf                      | 0644  | dd-agent   | root
/etc/dd-agent/conf.d/tomcat.yaml                   | 0644  | dd-agent   | root
[...]

import logging
import os.path
import os
import pwd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to import grp and pwd on Windows without error ? (I saw that they were Unix-only modules)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I haven't checked but you're probably right, I'll change this.

@olivielpeau olivielpeau force-pushed the olivielpeau/flare-log-file-permissions branch from 6c73362 to 39276ac Compare July 13, 2015 20:33
@degemer
Copy link
Member

degemer commented Jul 13, 2015

Once you have fixed the last esthetic comments (file name and separation between title and content), merge it (but cancel the build before). 🎉

@olivielpeau olivielpeau force-pushed the olivielpeau/flare-log-file-permissions branch 2 times, most recently from b75b74c to 47d20d0 Compare July 13, 2015 21:29
The permissions are collected in a permissions.log file.
All the files are added to the tar through an `_add_file_tar` method.
@olivielpeau olivielpeau force-pushed the olivielpeau/flare-log-file-permissions branch from 47d20d0 to 5cb3bba Compare July 13, 2015 21:32
@olivielpeau olivielpeau added this to the 5.5.0 milestone Jul 13, 2015
@olivielpeau
Copy link
Member Author

Thanks @degemer! I've changed the file name to permissions.log and added the separation you mentioned 💎

Merging.

olivielpeau added a commit that referenced this pull request Jul 13, 2015
…issions

[flare] Log permissions on collected files
@olivielpeau olivielpeau merged commit 7ed1e22 into master Jul 13, 2015
@olivielpeau olivielpeau deleted the olivielpeau/flare-log-file-permissions branch July 13, 2015 21:35
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.

2 participants