def convert_systemd_target_to_runlevel(target):
 if (target == 'poweroff.target'):
  runlevel = '0'
 elif (target == 'rescue.target'):
  runlevel = 's'
 elif (target == 'multi-user.target'):
  runlevel = '3'
 elif (target == 'graphical.target'):
  runlevel = '5'
 elif (target == 'reboot.target'):
  runlevel = '6'
 else:
  raise ValueError(('unknown target %s' % target))
 return runlevel

def convert_systemd_target_to_runlevel ( target ) : if ( target == 'poweroff.target' ) : runlevel = '0' elif ( target == 'rescue.target' ) : runlevel = 's' elif ( target == 'multi-user.target' ) : runlevel = '3' elif ( target == 'graphical.target' ) : runlevel = '5' elif ( target == 'reboot.target' ) : runlevel = '6' else : raise ValueError ( ( 'unknown target %s' % target ) ) return runlevel
convert systemd target to runlevel .