def _get_server_provider_info(self, query): try: server_provider = provider.ProviderFactory.get(query) header = "%s (server provider)" % server_provider.get_name() info = self._make_header(header) info += "\n\n" info += utils.format_docstring(server_provider.__doc__) return info except exceptions.PluginNotFound: return None
def _get_sla_info(self, query): try: found_sla = sla.SLA.get(query) header = "%s (SLA)" % found_sla.get_name() info = self._make_header(header) info += "\n\n" info += utils.format_docstring(found_sla.__doc__) + "\n" return info except exceptions.PluginNotFound: return None
def _get_deploy_engine_info(self, query): try: deploy_engine = engine.EngineFactory.get(query) header = "%s (deploy engine)" % deploy_engine.get_name() info = self._make_header(header) info += "\n\n" info += utils.format_docstring(deploy_engine.__doc__) return info except exceptions.PluginNotFound: return None
def _get_deploy_engine_info(self, query): try: deploy_engine = deploy.EngineFactory.get_by_name(query) header = "%s (deploy engine)" % deploy_engine.__name__ info = self._make_header(header) info += "\n\n" info += utils.format_docstring(deploy_engine.__doc__) return info except exceptions.NoSuchEngine: return None
def _get_server_provider_info(self, query): try: server_provider = serverprovider.ProviderFactory.get_by_name(query) header = "%s (server provider)" % server_provider.__name__ info = self._make_header(header) info += "\n\n" info += utils.format_docstring(server_provider.__doc__) return info except exceptions.NoSuchVMProvider: return None
def _get_sla_info(self, query): try: found_sla = sla.SLA.get_by_name(query) header = "%s (SLA)" % found_sla.OPTION_NAME info = self._make_header(header) info += "\n\n" info += utils.format_docstring(found_sla.__doc__) + "\n" return info except exceptions.NoSuchSLA: return None
def _get_sla_info(self, query): try: sla = sla_base.SLA.get_by_name(query) header = "%s (SLA)" % sla.OPTION_NAME info = self._make_header(header) info += "\n\n" info += utils.format_docstring(sla.__doc__) + "\n" return info except exceptions.NoSuchSLA: return None
def _get_deploy_engine_info(self, query): try: deploy_engine = engine.Engine.get(query) header = "%s (deploy engine)" % deploy_engine.get_name() info = self._make_header(header) info += "\n\n" info += utils.format_docstring(deploy_engine.__doc__) return info except exceptions.PluginNotFound: return None
def _get_scenario_group_info(self, query): try: scenario_group = scenario.Scenario.get_by_name(query) if not any(scenario.Scenario.is_scenario(scenario_group, m) for m in dir(scenario_group)): return None info = self._make_header("%s (benchmark scenario group)" % scenario_group.get_name()) info += "\n\n" info += utils.format_docstring(scenario_group.__doc__) scenarios = scenario_group.list_benchmark_scenarios() descriptions = [] for scenario_name in scenarios: cls, method_name = scenario_name.split(".") if hasattr(scenario_group, method_name): scenario_inst = getattr(scenario_group, method_name) doc = utils.parse_docstring(scenario_inst.__doc__) descr = doc["short_description"] or "" descriptions.append((scenario_name, descr)) info += self._compose_table("Benchmark scenarios", descriptions) return info except exceptions.NoSuchScenario: return None
def _get_scenario_group_info(self, query): try: scenario_group = scenario_base.Scenario.get_by_name(query) if not any(scenario_base.Scenario.is_scenario(scenario_group, m) for m in dir(scenario_group)): return None info = self._make_header("%s (benchmark scenario group)" % scenario_group.__name__) info += "\n\n" info += utils.format_docstring(scenario_group.__doc__) scenarios = scenario_group.list_benchmark_scenarios() descriptions = [] for scenario_name in scenarios: cls, method_name = scenario_name.split(".") if hasattr(scenario_group, method_name): scenario = getattr(scenario_group, method_name) doc = utils.parse_docstring(scenario.__doc__) descr = doc["short_description"] or "" descriptions.append((scenario_name, descr)) info += self._compose_table("Benchmark scenarios", descriptions) return info except exceptions.NoSuchScenario: return None