Return install.json contents.
509919
def install_json(self):
        """"""
        file_fqpn = os.path.join(self.app_path, 'install.json')
        if self._install_json is None:
            if os.path.isfile(file_fqpn):
                try:
                    with open(file_fqpn, 'r') as fh:
                        self._install_json = json.load(fh)
                except ValueError as e:
                    self.handle_error('Failed to load "{}" file ({}).'.format(file_fqpn, e))
            else:
                self.handle_error('File "{}" could not be found.'.format(file_fqpn))
        return self._install_json
345233
def install_json_schema(self):
        """"""
        if self._install_json_schema is None and self.install_json_schema_file is not None:
            # remove old schema file
            if os.path.isfile('tcex_json_schema.json'):
                # this file is now part of tcex.
                os.remove('tcex_json_schema.json')

            if os.path.isfile(self.install_json_schema_file):
                with open(self.install_json_schema_file) as fh:
                    self._install_json_schema = json.load(fh)
        return self._install_json_schema
1010381
function json (opts) {
  return {
    ...opts,
    headers: {
      ...opts.headers,
      'content-type': 'application/json'
    },
    body: JSON.stringify(opts.body)
  }
}
85051
def get(cls):
    """"""
    return {
      SourceRootConfig,
      Reporting,
      Reproducer,
      RunTracker,
      Changed,
      BinaryUtil.Factory,
      Subprocess.Factory
    }
488189
def get_install_requires():
    """"""
    base = os.path.abspath(os.path.dirname(__file__))
    requirements_file = os.path.join(base, 'requirements.txt')
    if not os.path.exists(requirements_file):
        return []
    with open(requirements_file, mode='rt', encoding='utf-8') as f:
        return f.read().splitlines()
90789
def json(self):
        """"""
        if self._data_json:
            return self._data_json

        if not self.data or self.content_type != 'application/json':
            return None

        self._data_json = json.loads(self.data)
        return self._data_json
85792
def elastic_install(self):
        
        with cd('/tmp'):
            if not exists('elastic.deb'):
                sudo('wget {0} -O elastic.deb'.format(
                    bigdata_conf.elastic_download_url
                ))

            sudo('dpkg -i elastic.deb')
            sudo('apt-get install -y')
59424
def _get_install_config():
    
    try:
        data_dir = _get_data_dir()
    except ValueError:
        return None
    config_dir = utils.safe_makedir(os.path.join(data_dir, "config"))
    return os.path.join(config_dir, "install-params.yaml")
1254012
def json(self):
        """"""
        if hasattr(self, '_json'):
            return self._json
        try:
            self._json = json.loads(self.text or self.content)
        except ValueError:
            self._json = None
        return self._json
925776
def _save_installed(self):
        """"""
        import json
        from utility import json_serial, get_json
        #This is a little tricky because the data file doesn't just have a list
        #of installed servers. It also manages the script's database that tracks
        #the user's interactions with it.
        fulldata = get_json(self.instpath, {})
        fulldata["installed"] = self.installed
        with open(self.instpath, 'w') as f:
            json.dump(fulldata, f, default=json_serial)
1058908
def get_manifest(self):
        """"""
        logger.debug("Getting manifest")
        text = self.get_text(self.get_manifest_key())
        return json.loads(text)
781174
def _CheckInstallSuccess(self):
    """"""
    if not os.path.exists(self.install_path):
      raise RuntimeError("Install failed, no files at: %s" % self.install_path)

    try:
      output = subprocess.check_output(["sc", "query", self.service_name])
      service_running = "RUNNING" in output
    except subprocess.CalledProcessError as e:
      if e.returncode == 1060:
        # 1060 means: The specified service does not exist as an installed
        # service.
        service_running = False
      else:
        raise

    if self.expect_service_running:
      if not service_running:
        raise RuntimeError(
            "GRR service not running after install, sc query output: %s" %
            output)
    else:
      if service_running:
        raise RuntimeError(
            "GRR service running after install with expect_service_running == "
            "False, sc query output: %s" % output)
378171
def as_json(self, ensure_ascii=False):
        """"""
        return json.dumps(self.as_dict, ensure_ascii=ensure_ascii)
1188394
def _get_patches(installed_only=False):
    '''
    
    '''
    patches = {}

    cmd = [_yum(), '--quiet', 'updateinfo', 'list', 'all']
    ret = __salt__['cmd.run_stdout'](
        cmd,
        python_shell=False
    )
    for line in salt.utils.itertools.split(ret, os.linesep):
        inst, advisory_id, sev, pkg = re.match(r'([i|\s]) ([^\s]+) +([^\s]+) +([^\s]+)',
                                               line).groups()
        if inst != 'i' and installed_only:
            continue
        patches[advisory_id] = {
            'installed': True if inst == 'i' else False,
            'summary': pkg
        }
    return patches
196775
def download(client, target_dir):
    """"""
    print('')
    print("download inappproducts")
    print('---------------------')
    products = client.list_inappproducts()

    for product in products:
        path = os.path.join(target_dir, 'products')
        del product['packageName']
        mkdir_p(path)
        with open(os.path.join(path, product['sku'] + '.json'), 'w') as outfile:
            print("save product for {0}".format(product['sku']))
            json.dump(
                product, outfile, sort_keys=True,
                indent=4, separators=(',', ': '))
46715
def get_setup(cls):
        """"""
        try:
            with open("setup.py") as f:
                return SetupVisitor(ast.parse(f.read()))
        except IOError as e:
            LOG.warning("Couldn't open setup file: %s", e)
            return SetupVisitor(ast.parse(""))
1327551
function() {
    return dexec( 'cd ' + this.settings.git + '; npm install' ).done(function( stdout, stderr ) {
        log( 'npm install successful' );
        log.extra( stdout, stderr );
      });
  }