def get_container_openshift_version(facts):
 for filename in ['/etc/sysconfig/%s-master', '/etc/sysconfig/%s-node']:
  env_path = (filename % facts['common']['service_type'])
  if (not os.path.exists(env_path)):
   continue
  with open(env_path) as env_file:
   for line in env_file:
    if line.startswith('IMAGE_VERSION='):
     tag = line[len('IMAGE_VERSION='):].strip()
     version = tag[1:].split('-')[0]
     return version
 return None

def get_container_openshift_version ( facts ) : for filename in [ '/etc/sysconfig/%s-master' , '/etc/sysconfig/%s-node' ] : env_path = ( filename % facts [ 'common' ] [ 'service_type' ] ) if ( not os . path . exists ( env_path ) ) : continue with open ( env_path ) as env_file : for line in env_file : if line . startswith ( 'IMAGE_VERSION=' ) : tag = line [ len ( 'IMAGE_VERSION=' ) : ] . strip ( ) version = tag [ 1 : ] . split ( '-' ) [ 0 ] return version return None
if containerized .