示例#1
0
文件: opts.py 项目: jethrosun/rally
def register_opts(opts):
    for category, options in opts:
        group = cfg.OptGroup(name=category, title="%s options" % category)
        if category != "DEFAULT":
            CONF.register_group(group)
            CONF.register_opts(options, group=group)
        else:
            CONF.register_opts(options)
示例#2
0
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.


from rally.common import cfg
from rally.task import utils

CONF = cfg.CONF

cleanup_group = cfg.OptGroup(name="cleanup", title="Cleanup Options")


# NOTE(andreykurilin): There are cases when there is no way to use any kind
#   of "name" for resource as an identifier of alignment resource to the
#   particular task run and even to Rally itself. Previously, we used empty
#   strings as a workaround for name matching specific templates, but
#   theoretically such behaviour can hide other cases when resource should have
#   a name property, but it is missed.
#   Let's use instances of specific class to return as a name of resources
#   which do not have names at all.
class NoName(object):
    def __init__(self, resource_type):
        self.resource_type = resource_type

    def __repr__(self):