1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Exit loop after detecting os-release

This commit is contained in:
Alexander Gubin 2015-02-16 13:18:11 +01:00
parent 1968f99691
commit d291dae582

View file

@ -369,6 +369,7 @@ class Facts(object):
else: else:
release = "0" # no minor number, so it is the first release release = "0" # no minor number, so it is the first release
self.facts['distribution_release'] = release self.facts['distribution_release'] = release
break
elif path == '/etc/SuSE-release': elif path == '/etc/SuSE-release':
if 'open' in data.lower(): if 'open' in data.lower():
data = data.splitlines() data = data.splitlines()
@ -378,7 +379,6 @@ class Facts(object):
release = re.search('CODENAME *= *([^\n]+)', line) release = re.search('CODENAME *= *([^\n]+)', line)
if release: if release:
self.facts['distribution_release'] = release.groups()[0].strip() self.facts['distribution_release'] = release.groups()[0].strip()
break
elif 'enterprise' in data.lower(): elif 'enterprise' in data.lower():
lines = data.splitlines() lines = data.splitlines()
distribution = lines[0].split()[0] distribution = lines[0].split()[0]
@ -391,7 +391,6 @@ class Facts(object):
if release: if release:
self.facts['distribution_release'] = release.group(1) self.facts['distribution_release'] = release.group(1)
self.facts['distribution_version'] = self.facts['distribution_version'] + '.' + release.group(1) self.facts['distribution_version'] = self.facts['distribution_version'] + '.' + release.group(1)
break
elif name == 'Debian': elif name == 'Debian':
data = get_file_content(path) data = get_file_content(path)
if 'Debian' in data: if 'Debian' in data: