python-diamond / Diamond

Diamond is a python daemon that collects system metrics and publishes them to Graphite (and others). It is capable of collecting cpu, memory, network, i/o, load and disk metrics. Additionally, it features an API for implementing custom collectors for gathering metrics from almost any source.
http://diamond.readthedocs.org/
MIT License
1.74k stars 601 forks source link

fix undefined var 'user' #654

Open joelrebel opened 7 years ago

joelrebel commented 7 years ago

when a user, group is defined in diamond.conf, we end up with the below error,

ERROR: Failed to set UID/GID. global name 'user' is not defined

Seems to be introduced in ad3862d76c,

This fixes it on nix based OS's, it needs testing on 'nt' based systems since 'pwd' might not be available on those

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 24.667% when pulling d46b0f532f1a5c9845dd902a9bd5a3c9c51cb8bd on joelrebel:master into f2bece462577a7c557be8a9f90f6b9340c3db571 on python-diamond:master.

JakSla commented 6 years ago

this can also be used as an alternative user = config['server']['user']

shortdudey123 commented 2 years ago

Can you rebase on master? As a side note, the alternative mentioned above won't work since user has two config sources, not one.