def _format_syslog_config(cmd_ret):
 ret_dict = {'success': (cmd_ret['retcode'] == 0)}
 if (cmd_ret['retcode'] != 0):
  ret_dict['message'] = cmd_ret['stdout']
 else:
  for line in cmd_ret['stdout'].splitlines():
   line = line.strip()
   cfgvars = line.split(': ')
   key = cfgvars[0].strip()
   value = cfgvars[1].strip()
   ret_dict[key] = value
 return ret_dict

def _format_syslog_config ( cmd_ret ) : ret_dict = { 'success' : ( cmd_ret [ 'retcode' ] == 0 ) } if ( cmd_ret [ 'retcode' ] != 0 ) : ret_dict [ 'message' ] = cmd_ret [ 'stdout' ] else : for line in cmd_ret [ 'stdout' ] . splitlines ( ) : line = line . strip ( ) cfgvars = line . split ( ': ' ) key = cfgvars [ 0 ] . strip ( ) value = cfgvars [ 1 ] . strip ( ) ret_dict [ key ] = value return ret_dict
helper function to format the stdout from the get_syslog_config function .