forked from StreisandEffect/streisand
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a proper Ansible version comparison (because stringwise, 2.8.10<2…
….8.4) (StreisandEffect#1770) (Also, you can't 'apt-get install python' without doing an 'apt-get update' first.)
- Loading branch information
Showing
3 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
from distutils.version import StrictVersion | ||
|
||
if len(sys.argv) != 3: | ||
print("Usage: version_at_least minimum_version version_to_check") | ||
sys.exit(1) | ||
|
||
minimum_version = StrictVersion(sys.argv[1].strip()) | ||
version_to_check = StrictVersion(sys.argv[2].strip()) | ||
|
||
if version_to_check >= minimum_version: | ||
sys.exit(0) | ||
else: | ||
sys.exit(1) |