def get_openshift_version(facts):
 version = None
 if ('common' in facts):
  if (('version' in facts['common']) and (facts['common']['version'] is not None)):
   return chomp_commit_offset(facts['common']['version'])
 if os.path.isfile('/usr/bin/openshift'):
  (_, output, _) = module.run_command(['/usr/bin/openshift', 'version'])
  version = parse_openshift_version(output)
 elif (('common' in facts) and ('is_containerized' in facts['common'])):
  version = get_container_openshift_version(facts)
 if ((not version) and os.path.isfile('/usr/local/bin/openshift')):
  (_, output, _) = module.run_command(['/usr/local/bin/openshift', 'version'])
  version = parse_openshift_version(output)
 return chomp_commit_offset(version)

def get_openshift_version ( facts ) : version = None if ( 'common' in facts ) : if ( ( 'version' in facts [ 'common' ] ) and ( facts [ 'common' ] [ 'version' ] is not None ) ) : return chomp_commit_offset ( facts [ 'common' ] [ 'version' ] ) if os . path . isfile ( '/usr/bin/openshift' ) : ( _ , output , _ ) = module . run_command ( [ '/usr/bin/openshift' , 'version' ] ) version = parse_openshift_version ( output ) elif ( ( 'common' in facts ) and ( 'is_containerized' in facts [ 'common' ] ) ) : version = get_container_openshift_version ( facts ) if ( ( not version ) and os . path . isfile ( '/usr/local/bin/openshift' ) ) : ( _ , output , _ ) = module . run_command ( [ '/usr/local/bin/openshift' , 'version' ] ) version = parse_openshift_version ( output ) return chomp_commit_offset ( version )
get current version of openshift on the host .