def _parse_global_variables(user_cidr, inventory, user_defined_config):
 if ('all' not in inventory):
  inventory['all'] = {}
 if ('vars' not in inventory['all']):
  inventory['all']['vars'] = {}
 inventory['all']['vars']['container_cidr'] = user_cidr
 if ('global_overrides' in user_defined_config):
  if isinstance(user_defined_config['global_overrides'], dict):
   inventory['all']['vars'].update(user_defined_config['global_overrides'])
   logger.debug('Applied global_overrides')
   kept_vars = user_defined_config['global_overrides'].keys()
   kept_vars.append('container_cidr')
   for key in inventory['all']['vars'].keys():
    if (key not in kept_vars):
     logger.debug('Deleting key %s from inventory', key)
     del inventory['all']['vars'][key]

def _parse_global_variables ( user_cidr , inventory , user_defined_config ) : if ( 'all' not in inventory ) : inventory [ 'all' ] = { } if ( 'vars' not in inventory [ 'all' ] ) : inventory [ 'all' ] [ 'vars' ] = { } inventory [ 'all' ] [ 'vars' ] [ 'container_cidr' ] = user_cidr if ( 'global_overrides' in user_defined_config ) : if isinstance ( user_defined_config [ 'global_overrides' ] , dict ) : inventory [ 'all' ] [ 'vars' ] . update ( user_defined_config [ 'global_overrides' ] ) logger . debug ( 'Applied global_overrides' ) kept_vars = user_defined_config [ 'global_overrides' ] . keys ( ) kept_vars . append ( 'container_cidr' ) for key in inventory [ 'all' ] [ 'vars' ] . keys ( ) : if ( key not in kept_vars ) : logger . debug ( 'Deleting key %s from inventory' , key ) del inventory [ 'all' ] [ 'vars' ] [ key ]
add any extra variables that may have been set in config .