Exemplo n.º 1
0
 def __init__(self, stdout=None, stderr=None, return_code=0, transform_csv=False):
     self.stdout = stdout
     self.stderr = stderr
     self.return_code = return_code
     self.transform_csv = transform_csv
     #  Does not make sense to return suspicious CSV if ($? <> 0)
     if transform_csv and self.return_code == 0:
         self.stdout = csv_to_dictionary(stdout) if stdout else {}
Exemplo n.º 2
0
 def __init__(
         self, stdout=None, stderr=None, return_code=0, output_format=None):
     self.stdout = stdout
     self.stderr = stderr
     self.return_code = return_code
     self.output_format = output_format
     #  Does not make sense to return suspicious output if ($? <> 0)
     if output_format and self.return_code == 0:
         if output_format == 'csv':
             self.stdout = csv_to_dictionary(stdout) if stdout else {}
         if output_format == 'json':
             self.stdout = json.loads(stdout) if stdout else None
Exemplo n.º 3
0
 def __init__(self,
              stdout=None,
              stderr=None,
              return_code=0,
              transform_csv=False):
     self.stdout = stdout
     self.stderr = stderr
     self.return_code = return_code
     self.transform_csv = transform_csv
     #  Does not make sense to return suspicious CSV if ($? <> 0)
     if transform_csv and self.return_code == 0:
         self.stdout = csv_to_dictionary(stdout) if stdout else {}
Exemplo n.º 4
0
 def __init__(self,
              stdout=None,
              stderr=None,
              return_code=0,
              output_format=None):
     self.stdout = stdout
     self.stderr = stderr
     self.return_code = return_code
     self.output_format = output_format
     #  Does not make sense to return suspicious output if ($? <> 0)
     if output_format and self.return_code == 0:
         if output_format == 'csv':
             self.stdout = csv_to_dictionary(stdout) if stdout else {}
         if output_format == 'json':
             self.stdout = json.loads(stdout) if stdout else None