Commit 28609fee authored by Sebastien Luttringer's avatar Sebastien Luttringer
Browse files

add is_version in tools

parent 9a67fb7c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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: