diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-04-25 12:52:43 -0400 |
---|---|---|
committer | Scott Dodson <sdodson@redhat.com> | 2016-04-25 13:58:33 -0400 |
commit | b90fb397908c4e5f9001724e7f8ddcc25f4ffdea (patch) | |
tree | 13e79f1befe7a2011fbece21233317b30d8dba85 /filter_plugins | |
parent | 04b52454275572f9d09e76c6ce46bdd60aa46c72 (diff) | |
download | openshift-b90fb397908c4e5f9001724e7f8ddcc25f4ffdea.tar.gz openshift-b90fb397908c4e5f9001724e7f8ddcc25f4ffdea.tar.bz2 openshift-b90fb397908c4e5f9001724e7f8ddcc25f4ffdea.tar.xz openshift-b90fb397908c4e5f9001724e7f8ddcc25f4ffdea.zip |
Fix image version handling for v1.2.0-rc1
Diffstat (limited to 'filter_plugins')
-rw-r--r-- | filter_plugins/oo_filters.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index 3da4562ac..0f54d8a0a 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -820,15 +820,18 @@ class FilterModule(object): def oo_image_tag_to_rpm_version(version, include_dash=False): """ Convert an image tag string to an RPM version if necessary Empty strings and strings that are already in rpm version format - are ignored. + are ignored. Also remove non semantic version components. Ex. v3.2.0.10 -> -3.2.0.10 + v1.2.0-rc1 -> -1.2.0 """ 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.split('-')[0] if include_dash: version = "-" + version |