Skip to content

Commit

Permalink
Renamed variables to stdout and stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
spike77453 committed Jun 28, 2018
1 parent 79d4a3b commit f4e38b4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions bin/pynagsystemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ def probe(self):
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
pres, err = p.communicate()
stdout, stderr = p.communicate()
except OSError as e:
raise nagiosplugin.CheckError(e)

if err:
raise nagiosplugin.CheckError(err)
if stderr:
raise nagiosplugin.CheckError(stderr)

if pres:
for line in io.StringIO(pres.decode('utf-8')):
if stdout:
for line in io.StringIO(stdout.decode('utf-8')):
split_line = line.split()
unit = split_line[0]
active = split_line[2]
Expand All @@ -53,14 +53,14 @@ def probe(self):
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
pres, err = p.communicate()
stdout, stderr = p.communicate()
except OSError as e:
raise nagiosplugin.CheckError(e)

if err:
raise nagiosplugin.CheckError(err)
if pres:
for line in io.StringIO(pres.decode('utf-8')):
if stderr:
raise nagiosplugin.CheckError(stderr)
if stdout:
for line in io.StringIO(stdout.decode('utf-8')):
yield nagiosplugin.Metric(self.service, line.strip(), context='systemd')


Expand Down

0 comments on commit f4e38b4

Please sign in to comment.