Set initial value to violation

parent 6751413c
......@@ -122,6 +122,7 @@ def version_satisfy_requirement(requirements, input_version):
Returns if input_version satisfies requirement.
'''
status = True
violation = ''
for requirement in requirements:
violation = requirement
check, ver = get_operator(requirement)
......@@ -130,25 +131,25 @@ def version_satisfy_requirement(requirements, input_version):
status = False
if check == '=' and input_version == ver:
status = True
violation = None
violation = ''
elif check == '<=' and input_version <= ver:
status = True
violation = None
violation = ''
elif check == '<' and input_version < ver:
status = True
violation = None
violation = ''
elif check == '>' and input_version > ver:
status = True
violation = None
violation = ''
elif check == '>=' and input_version >= ver:
status = True
violation = None
violation = ''
elif check == '!=' and input_version != ver:
status = True
violation = None
violation = ''
elif check == '~>':
status = True
violation = None
violation = ''
input_version_int = input_version.version
ver_int = ver.version
n = min(len(input_version_int), len(ver_int)) - 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment