diff options
-rw-r--r-- | sos/policies/amazon.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sos/policies/amazon.py b/sos/policies/amazon.py index e1bfe1df..ce60c5e3 100644 --- a/sos/policies/amazon.py +++ b/sos/policies/amazon.py @@ -12,6 +12,7 @@ from __future__ import print_function from sos.policies.redhat import RedHatPolicy, OS_RELEASE +import os class AmazonPolicy(RedHatPolicy): @@ -25,6 +26,9 @@ class AmazonPolicy(RedHatPolicy): @classmethod def check(cls): + if not os.path.exists(OS_RELEASE): + return False + with open(OS_RELEASE, 'r') as f: for line in f: if line.startswith('NAME'): |