def version_compare(value, version, operator='eq', strict=False):
 op_map = {'==': 'eq', '=': 'eq', 'eq': 'eq', '<': 'lt', 'lt': 'lt', '<=': 'le', 'le': 'le', '>': 'gt', 'gt': 'gt', '>=': 'ge', 'ge': 'ge', '!=': 'ne', '<>': 'ne', 'ne': 'ne'}
 if strict:
  Version = StrictVersion
 else:
  Version = LooseVersion
 if (operator in op_map):
  operator = op_map[operator]
 else:
  raise errors.AnsibleFilterError('Invalid operator type')
 try:
  method = getattr(py_operator, operator)
  return method(Version(str(value)), Version(str(version)))
 except Exception as e:
  raise errors.AnsibleFilterError(('Version comparison: %s' % e))

def version_compare ( value , version , operator = 'eq' , strict = False ) : op_map = { '==' : 'eq' , '=' : 'eq' , 'eq' : 'eq' , '<' : 'lt' , 'lt' : 'lt' , '<=' : 'le' , 'le' : 'le' , '>' : 'gt' , 'gt' : 'gt' , '>=' : 'ge' , 'ge' : 'ge' , '!=' : 'ne' , '<>' : 'ne' , 'ne' : 'ne' } if strict : Version = StrictVersion else : Version = LooseVersion if ( operator in op_map ) : operator = op_map [ operator ] else : raise errors . AnsibleFilterError ( 'Invalid operator type' ) try : method = getattr ( py_operator , operator ) return method ( Version ( str ( value ) ) , Version ( str ( version ) ) ) except Exception as e : raise errors . AnsibleFilterError ( ( 'Version comparison: %s' % e ) )
compare two votable version identifiers .