code: def parse(out):
      '''
      Extract json from out.
  
      Parameter
          out: Type string. The data returned by the
          ssh command.
      '''
      jsonret = []
      in_json = False
      for ln_ in out.split('\n'):
          if '{' in ln_:
              in_json = True
          if in_json:
              jsonret.append(ln_)
          if '}' in ln_:
              in_json = False
      return salt.utils.json.loads('\n'.join(jsonret)f parse(out):
      '''
      Extract json from out.
  
      Parameter
          out: Type string. The data returned by the
          ssh command.
      '''
      jsonret = []
      in_json = False
      for ln_ in out.split('\n'):
          if '{' in ln_:
              in_json = True
          if in_json:
              jsonret.append(ln_)
          if '}' in ln_:
              in_json = False
      return salt.utils.json.loads('\n'.join(jsonret))
docs: Extract json from out.
  
      Parameter
          out: Type string. The data returned by the
          ssh command.