def oo_openshift_env(hostvars):
 if (not issubclass(type(hostvars), dict)):
  raise errors.AnsibleFilterError('|failed expects hostvars is a dict')
 facts = {}
 regex = re.compile('^openshift_.*')
 for key in hostvars:
  if regex.match(key):
   facts[key] = hostvars[key]
 migrations = {'openshift_router_selector': 'openshift_hosted_router_selector', 'openshift_registry_selector': 'openshift_hosted_registry_selector'}
 for (old_fact, new_fact) in migrations.items():
  if ((old_fact in facts) and (new_fact not in facts)):
   facts[new_fact] = facts[old_fact]
 return facts

def oo_openshift_env ( hostvars ) : if ( not issubclass ( type ( hostvars ) , dict ) ) : raise errors . AnsibleFilterError ( '|failed expects hostvars is a dict' ) facts = { } regex = re . compile ( '^openshift_.*' ) for key in hostvars : if regex . match ( key ) : facts [ key ] = hostvars [ key ] migrations = { 'openshift_router_selector' : 'openshift_hosted_router_selector' , 'openshift_registry_selector' : 'openshift_hosted_registry_selector' } for ( old_fact , new_fact ) in migrations . items ( ) : if ( ( old_fact in facts ) and ( new_fact not in facts ) ) : facts [ new_fact ] = facts [ old_fact ] return facts
return facts which begin with "openshift_" and translate legacy facts to their openshift_env counterparts .