def migrate_oauth_template_facts(facts):
 if (('master' in facts) and ('oauth_template' in facts['master'])):
  if ('oauth_templates' not in facts['master']):
   facts['master']['oauth_templates'] = {'login': facts['master']['oauth_template']}
  elif ('login' not in facts['master']['oauth_templates']):
   facts['master']['oauth_templates']['login'] = facts['master']['oauth_template']
 return facts

def migrate_oauth_template_facts ( facts ) : if ( ( 'master' in facts ) and ( 'oauth_template' in facts [ 'master' ] ) ) : if ( 'oauth_templates' not in facts [ 'master' ] ) : facts [ 'master' ] [ 'oauth_templates' ] = { 'login' : facts [ 'master' ] [ 'oauth_template' ] } elif ( 'login' not in facts [ 'master' ] [ 'oauth_templates' ] ) : facts [ 'master' ] [ 'oauth_templates' ] [ 'login' ] = facts [ 'master' ] [ 'oauth_template' ] return facts
migrate an old oauth template fact to a newer format if its present .