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:
parent
1968f99691
commit
d291dae582
1 changed files with 1 additions and 2 deletions
|
@ -369,6 +369,7 @@ class Facts(object):
|
|||
else:
|
||||
release = "0" # no minor number, so it is the first release
|
||||
self.facts['distribution_release'] = release
|
||||
break
|
||||
elif path == '/etc/SuSE-release':
|
||||
if 'open' in data.lower():
|
||||
data = data.splitlines()
|
||||
|
@ -378,7 +379,6 @@ class Facts(object):
|
|||
release = re.search('CODENAME *= *([^\n]+)', line)
|
||||
if release:
|
||||
self.facts['distribution_release'] = release.groups()[0].strip()
|
||||
break
|
||||
elif 'enterprise' in data.lower():
|
||||
lines = data.splitlines()
|
||||
distribution = lines[0].split()[0]
|
||||
|
@ -391,7 +391,6 @@ class Facts(object):
|
|||
if release:
|
||||
self.facts['distribution_release'] = release.group(1)
|
||||
self.facts['distribution_version'] = self.facts['distribution_version'] + '.' + release.group(1)
|
||||
break
|
||||
elif name == 'Debian':
|
||||
data = get_file_content(path)
|
||||
if 'Debian' in data:
|
||||
|
|
Loading…
Reference in a new issue