aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2019-03-21 10:11:41 +0100
committerBryn M. Reeves <bmr@redhat.com>2019-03-21 09:59:49 +0000
commite1784718a3c624c522c1d2879cfe543e563ac580 (patch)
treec3de443e1e0ae8a8fa31446e3cce6092eb2fb2af
parent27aa22ff917cc20f9cc9a9e1e6a1b1a4a46042da (diff)
downloadsos-e1784718a3c624c522c1d2879cfe543e563ac580.tar.gz
[manageiq] import os.environ variable properly
os.environ is a variable not a module, so "import os.environ" doesnt work, causing plugin isnt loaded. Resolves: #1607 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/manageiq.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/sos/plugins/manageiq.py b/sos/plugins/manageiq.py
index f5ae9f18..9d096324 100644
--- a/sos/plugins/manageiq.py
+++ b/sos/plugins/manageiq.py
@@ -12,9 +12,8 @@
# See the LICENSE file in the source distribution for further information.
from sos.plugins import Plugin, RedHatPlugin
-
+from os import environ
import os.path
-import os.environ
class ManageIQ(Plugin, RedHatPlugin):
@@ -74,8 +73,8 @@ class ManageIQ(Plugin, RedHatPlugin):
])
self.add_copy_spec("/var/log/tower.log")
- if "APPLIANCE_PG_DATA" in os.environ:
- pg_dir = os.environ["APPLIANCE_PG_DATA"]
+ if environ.get("APPLIANCE_PG_DATA"):
+ pg_dir = environ.get("APPLIANCE_PG_DATA")
self.add_copy_spec([
os.path.join(pg_dir, 'pg_log'),
os.path.join(pg_dir, 'postgresql.conf')