Skip to content
Snippets Groups Projects
Commit 28609fee authored by Sebastien Luttringer's avatar Sebastien Luttringer
Browse files

add is_version in tools

parent 9a67fb7c
No related branches found
No related tags found
No related merge requests found
......@@ -505,6 +505,13 @@ def chroot(path, shell="/bin/bash", mount=True):
# revert preparation of chroot
unprepare_chroot(path, mount)
def is_version(version):
'''
Check if version is valid
'''
if re.match("^(\d+)(?:([-~+]).*)?$", version) is None:
raise TypeError("Invalid version format %s" % buf)
def compare_versions(v1, v2):
'''
This function compare version :param v1: and version :param v2:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment