yandextank/plugins/Pandora/plugin.py
def patch_config(self, config):
        """
        download remote resources, replace links with local filenames
        add result file section
        :param dict config: pandora config
        """
        # get expvar parameters
        if config.get("monitoring"):
            if config["monitoring"].get("expvar"):
                self.expvar = config["monitoring"]["expvar"].get("enabled")
                if config["monitoring"]["expvar"].get("port"):
                    self.expvar_port = config["monitoring"]["expvar"].get("port")
                else:
                    self.expvar_port = self.DEFAULT_EXPVAR_PORT
        # or set if expvar not exists
        else:
            config["monitoring"] = {
                "expvar": {
                    "enabled": True,
                }
            }
            self.expvar = True
            self.expvar_port = self.DEFAULT_EXPVAR_PORT

        # FIXME this is broken for custom ammo providers due to interface incompatibility
        # FIXME refactor pandora plx
        for pool in config['pools']:
            if pool.get('ammo', {}).get('file', ''):
                self.ammofile = pool['ammo']['file']
                pool['ammo']['file'] = resource_manager.resource_filename(
                    self.ammofile
                )
            if not pool.get('result') or 'phout' not in pool.get('result', {}).get('type', ''):
                logger.warning('Seems like pandora result file not specified... adding defaults')
                pool['result'] = dict(
                    destination=self.DEFAULT_REPORT_FILE,
                    type='phout',
                )
        return config
def patch_config(self, config):
        """
        download remote resources, replace links with local filenames
        add result file section
        :param dict config: pandora config
        """
        # get expvar parameters
        if config.get("monitoring"):
            if config["monitoring"].get("expvar"):
                self.expvar = config["monitoring"]["expvar"].get("enabled")
                if config["monitoring"]["expvar"].get("port"):
                    self.expvar_port = config["monitoring"]["expvar"].get("port")
                else:
                    self.expvar_port = self.DEFAULT_EXPVAR_PORT
        # or set if expvar not exists
        else:
            config["monitoring"] = {
                "expvar": {
                    "enabled": True,
                }
            }
            self.expvar = True
            self.expvar_port = self.DEFAULT_EXPVAR_PORT

        # FIXME this is broken for custom ammo providers due to interface incompatibility
        # FIXME refactor pandora plx
        for pool in config['pools']:
            if pool.get('ammo', {}).get('file', ''):
                self.ammofile = pool['ammo']['file']
                pool['ammo']['file'] = resource_manager.resource_filename(
                    self.ammofile
                )
            if not pool.get('result') or 'phout' not in pool.get('result', {}).get('type', ''):
                logger.warning('Seems like pandora result file not specified... adding defaults')
                pool['result'] = dict(
                    destination=self.DEFAULT_REPORT_FILE,
                    type='phout',
                )
        return config
download remote resources, replace links with local filenames
        add result file section
        :param dict config: pandora config