forked from sig_core/toolkit
add regex check in def
This commit is contained in:
parent
6f5b1f59ac
commit
dadc382dae
@ -89,6 +89,10 @@ def set_releasever(releasever):
|
|||||||
"""
|
"""
|
||||||
Sets a release version
|
Sets a release version
|
||||||
"""
|
"""
|
||||||
|
check_for_rel = re.search(regex, releasever)
|
||||||
|
if not check_for_rel:
|
||||||
|
print(f'Release version does not conform to X.Y or it does not start with {dist}')
|
||||||
|
sys.exit(1)
|
||||||
print(f'Setting releasever to {releasever}')
|
print(f'Setting releasever to {releasever}')
|
||||||
with open('/etc/dnf/vars/releasever', 'w') as f:
|
with open('/etc/dnf/vars/releasever', 'w') as f:
|
||||||
f.write(releasever)
|
f.write(releasever)
|
||||||
|
Loading…
Reference in New Issue
Block a user