def apply_network_settings(**settings):
 if ('require_reboot' not in settings):
  settings['require_reboot'] = False
 if ('apply_hostname' not in settings):
  settings['apply_hostname'] = False
 hostname_res = True
 if (settings['apply_hostname'] in _CONFIG_TRUE):
  if ('hostname' in settings):
   hostname_res = __salt__['network.mod_hostname'](settings['hostname'])
  else:
   log.warning('The network state sls is trying to apply hostname changes but no hostname is defined.')
   hostname_res = False
 res = True
 if (settings['require_reboot'] in _CONFIG_TRUE):
  log.warning('The network state sls is requiring a reboot of the system to properly apply network configuration.')
  res = True
 else:
  res = __salt__['service.restart']('network')
 return (hostname_res and res)

def apply_network_settings ( ** settings ) : if ( 'require_reboot' not in settings ) : settings [ 'require_reboot' ] = False if ( 'apply_hostname' not in settings ) : settings [ 'apply_hostname' ] = False hostname_res = True if ( settings [ 'apply_hostname' ] in _CONFIG_TRUE ) : if ( 'hostname' in settings ) : hostname_res = __salt__ [ 'network.mod_hostname' ] ( settings [ 'hostname' ] ) else : log . warning ( 'The network state sls is trying to apply hostname changes but no hostname is defined.' ) hostname_res = False res = True if ( settings [ 'require_reboot' ] in _CONFIG_TRUE ) : log . warning ( 'The network state sls is requiring a reboot of the system to properly apply network configuration.' ) res = True else : res = __salt__ [ 'service.restart' ] ( 'network' ) return ( hostname_res and res )
apply global network configuration .