|
@@ -881,13 +881,12 @@ class FilterModule(object):
|
|
|
"""
|
|
|
if not isinstance(version, basestring):
|
|
|
raise errors.AnsibleFilterError("|failed expects a string or unicode")
|
|
|
-
|
|
|
-
|
|
|
if version.startswith("v"):
|
|
|
version = version[1:]
|
|
|
+
|
|
|
version = version.split('-')[0]
|
|
|
|
|
|
- if include_dash and not version.startswith("-"):
|
|
|
+ if include_dash and version and not version.startswith("-"):
|
|
|
version = "-" + version
|
|
|
|
|
|
return version
|