def _default_runlevel():
 try:
  with salt.utils.fopen('/etc/init/rc-sysinit.conf') as fp_:
   for line in fp_:
    if line.startswith('env DEFAULT_RUNLEVEL'):
     runlevel = line.split('=')[(-1)].strip()
 except Exception:
  return '2'
 try:
  with salt.utils.fopen('/etc/inittab') as fp_:
   for line in fp_:
    if ((not line.startswith('#')) and ('initdefault' in line)):
     runlevel = line.split(':')[1]
 except Exception:
  pass
 try:
  valid_strings = set(('0', '1', '2', '3', '4', '5', '6', 's', 'S', '-s', 'single'))
  with salt.utils.fopen('/proc/cmdline') as fp_:
   for line in fp_:
    for arg in line.strip().split():
     if (arg in valid_strings):
      runlevel = arg
      break
 except Exception:
  pass
 return runlevel

def _default_runlevel ( ) : try : with salt . utils . fopen ( '/etc/init/rc-sysinit.conf' ) as fp_ : for line in fp_ : if line . startswith ( 'env DEFAULT_RUNLEVEL' ) : runlevel = line . split ( '=' ) [ ( - 1 ) ] . strip ( ) except Exception : return '2' try : with salt . utils . fopen ( '/etc/inittab' ) as fp_ : for line in fp_ : if ( ( not line . startswith ( '#' ) ) and ( 'initdefault' in line ) ) : runlevel = line . split ( ':' ) [ 1 ] except Exception : pass try : valid_strings = set ( ( '0' , '1' , '2' , '3' , '4' , '5' , '6' , 's' , 'S' , '-s' , 'single' ) ) with salt . utils . fopen ( '/proc/cmdline' ) as fp_ : for line in fp_ : for arg in line . strip ( ) . split ( ) : if ( arg in valid_strings ) : runlevel = arg break except Exception : pass return runlevel
try to figure out the default runlevel .