summaryrefslogtreecommitdiffstats
path: root/filter_plugins
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-07-14 18:49:24 -0400
committerGitHub <noreply@github.com>2016-07-14 18:49:24 -0400
commit65ffae3e6edc8902c591dfef792a505a16029698 (patch)
treea28948529ce2a4c8b700aaf5352173be1aea8f8a /filter_plugins
parent1a6b1bf010b661feb8495d4088f9a0f2640b5658 (diff)
parent03f31fdc581eea090388b5a60b3818167eb47c0c (diff)
downloadopenshift-65ffae3e6edc8902c591dfef792a505a16029698.tar.gz
openshift-65ffae3e6edc8902c591dfef792a505a16029698.tar.bz2
openshift-65ffae3e6edc8902c591dfef792a505a16029698.tar.xz
openshift-65ffae3e6edc8902c591dfef792a505a16029698.zip
Merge pull request #1945 from dgoodwin/upgrade33
openshift_release / version / upgrade improvements
Diffstat (limited to 'filter_plugins')
-rw-r--r--filter_plugins/oo_filters.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index a81438188..d706d0304 100644
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -803,14 +803,13 @@ class FilterModule(object):
"""
if not isinstance(version, basestring):
raise errors.AnsibleFilterError("|failed expects a string or unicode")
- # TODO: Do we need to make this actually convert v1.2.0-rc1 into 1.2.0-0.rc1
- # We'd need to be really strict about how we build the RPM Version+Release
if version.startswith("v"):
- version = version.replace("v", "")
+ version = version[1:]
+ # Strip release from requested version, we no longer support this.
version = version.split('-')[0]
- if include_dash:
- version = "-" + version
+ if include_dash and version and not version.startswith("-"):
+ version = "-" + version
return version