From 099ca9c399ad96ecd29bd68df5930a9da37b94d1 Mon Sep 17 00:00:00 2001 From: Praveen K Pandey Date: Tue, 13 Feb 2018 17:26:53 +0530 Subject: [PATCH] Fixed issue in avocado:utils:distro In SUSE distro distro.detect() is failing as undefined variable log: START 1-generic/sosreport.py:sosreport_test.test;run-cd82 Test metadata: filename: /root/avocado-fvt-wrapper/tests/avocado-misc-tests/generic/sosreport.py DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file) Reproduced traceback from: /usr/lib/python2.7/site-packages/avocado_framework-58.0-py2.7.egg/avocado/core/test.py:814 Traceback (most recent call last): File "/root/avocado-fvt-wrapper/tests/avocado-misc-tests/generic/sosreport.py", line 42, in setUp dist = distro.detect() File "/usr/lib/python2.7/site-packages/avocado_framework-58.0-py2.7.egg/avocado/utils/distro.py", line 416, in detect distro_result = probe_instance.get_distro() File "/usr/lib/python2.7/site-packages/avocado_framework-58.0-py2.7.egg/avocado/utils/distro.py", line 370, in get_distro with open(self.check_file) as check_file: AttributeError: 'SUSEProbe' object has no attribute 'check_file' Signed-off-by: Praveen K Pandey --- avocado/utils/distro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avocado/utils/distro.py b/avocado/utils/distro.py index 4c0d85cf..dfa48500 100644 --- a/avocado/utils/distro.py +++ b/avocado/utils/distro.py @@ -367,7 +367,7 @@ class SUSEProbe(Probe): version_id_re = re.compile(r'VERSION_ID="([\d\.]*)"') version_id = None - with open(self.check_file) as check_file: + with open(self.CHECK_FILE) as check_file: for line in check_file: match = version_id_re.match(line) if match: -- GitLab