def migrate_docker_facts(facts):
 params = {'common': ('additional_registries', 'insecure_registries', 'blocked_registries', 'options'), 'node': ('log_driver', 'log_options')}
 if ('docker' not in facts):
  facts['docker'] = {}
 for role in params.keys():
  if (role in facts):
   for param in params[role]:
    old_param = ('docker_' + param)
    if (old_param in facts[role]):
     facts['docker'][param] = facts[role].pop(old_param)
 if (('node' in facts) and ('portal_net' in facts['node'])):
  facts['docker']['hosted_registry_network'] = facts['node'].pop('portal_net')
 if (('log_options' in facts['docker']) and isinstance(facts['docker']['log_options'], string_types)):
  facts['docker']['log_options'] = facts['docker']['log_options'].split(',')
 return facts

def migrate_docker_facts ( facts ) : params = { 'common' : ( 'additional_registries' , 'insecure_registries' , 'blocked_registries' , 'options' ) , 'node' : ( 'log_driver' , 'log_options' ) } if ( 'docker' not in facts ) : facts [ 'docker' ] = { } for role in params . keys ( ) : if ( role in facts ) : for param in params [ role ] : old_param = ( 'docker_' + param ) if ( old_param in facts [ role ] ) : facts [ 'docker' ] [ param ] = facts [ role ] . pop ( old_param ) if ( ( 'node' in facts ) and ( 'portal_net' in facts [ 'node' ] ) ) : facts [ 'docker' ] [ 'hosted_registry_network' ] = facts [ 'node' ] . pop ( 'portal_net' ) if ( ( 'log_options' in facts [ 'docker' ] ) and isinstance ( facts [ 'docker' ] [ 'log_options' ] , string_types ) ) : facts [ 'docker' ] [ 'log_options' ] = facts [ 'docker' ] [ 'log_options' ] . split ( ',' ) return facts
apply migrations for docker facts .