rally/doc/samples/plugins/scenario/scenario_plugin.py
Olga Kopylova 2c368272c9 Improve plugins and apply loading for runners and contexts plugins
Provide plugins loading for runners and contexts, improve samples.
Plugins now can be loaded from ~/.rally/plugins and /opt/rally/plugins
and any it's subdirectories.

Closes-Bug: #1320942

Change-Id: I213086e7eae17e297c398c301f5ed8d2331d951e
2014-10-24 10:25:10 +00:00

24 lines
736 B
Python

from rally.benchmark.scenarios import base
class ScenarioPlugin(base.Scenario):
"""Sample of plugin which lists flavors"""
@base.atomic_action_timer("list_flavors")
def _list_flavors(self):
"""Sample of usage clients - list flavors
You can use self.context, self.admin_clients and self.clients which are
initialized on scenario instanse creation"""
self.clients("nova").flavors.list()
@base.atomic_action_timer("list_flavors_as_admin")
def _list_flavors_as_admin(self):
"""The same with admin clients"""
self.admin_clients("nova").flavors.list()
@base.scenario()
def list_flavors(self):
self._list_flavors()
self._list_flavors_as_admin()