Skip to content

Commit

Permalink
Merge pull request #1389 from DataDog/leo/varnishadm
Browse files Browse the repository at this point in the history
[varnish] fix `varnishadm` subp call with sudo
  • Loading branch information
LeoCavaille committed Feb 20, 2015
2 parents b5b95ad + 54a5387 commit 08e8986
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions checks.d/varnish.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ def check(self, instance):
varnishadm_path = instance.get('varnishadm')
if varnishadm_path:
secretfile_path = instance.get('secretfile', '/etc/varnish/secret')
varnishadm_path = 'sudo %s' % varnishadm_path
cmd = [varnishadm_path, '-S', secretfile_path, 'debug.health']
cmd = ['sudo', varnishadm_path, '-S', secretfile_path, 'debug.health']
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
output, _ = proc.communicate()
if output:
Expand Down

0 comments on commit 08e8986

Please sign in to comment.