mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Update pdbedit so it passes the updated tests
This commit is contained in:
parent
2065fa15f0
commit
3a0328dd04
1 changed files with 4 additions and 4 deletions
|
@ -49,15 +49,15 @@ def __virtual__():
|
|||
if not salt.utils.path.which("pdbedit"):
|
||||
return (False, "pdbedit command is not available")
|
||||
|
||||
# NOTE: check version is >= 4.8.x
|
||||
# NOTE: check version is >= 4.5.x
|
||||
ver = salt.modules.cmdmod.run("pdbedit -V")
|
||||
ver_regex = re.compile(r"^Version\s(\d+)\.(\d+)\.(\d+)$")
|
||||
ver_regex = re.compile(r"^Version\s(\d+)\.(\d+)\.(\d+).*$")
|
||||
ver_match = ver_regex.match(ver)
|
||||
if not ver_match:
|
||||
return (False, "pdbedit -V returned an unknown version format")
|
||||
|
||||
if not (int(ver_match.group(1)) >= 4 and int(ver_match.group(2)) >= 8):
|
||||
return (False, "pdbedit is to old, 4.8.0 or newer is required")
|
||||
if not (int(ver_match.group(1)) >= 4 and int(ver_match.group(2)) >= 5):
|
||||
return (False, "pdbedit is to old, 4.5.0 or newer is required")
|
||||
|
||||
return __virtualname__
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue