This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#To add new points in code you have 4 ways: | |
from osprofiler import profiler | |
def some_func(): | |
profiler.start("point_name", {"any_key": "with_any_value"}) | |
# your code | |
profiler.stop({"any_info_about_point": "in_this_dict"}) | |
@profiler.trace("point_name", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mock | |
@mock.patch("<path_to_module_with_function>.open", create=True) | |
def test_some_your_method(self, mock_open): | |
mock.open.side_effect = [ | |
mock.mock_open(read_data="Data from file 1").return_value, | |
mock.mock_open(read_data="Data from file 2").return_value | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
VMTasks.boot_runcommand_delete: | |
{% for flavor in flavors %} | |
{% for image in images %} | |
- | |
args: | |
flavor: | |
name: {{flavor}} | |
image: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Certification Tasks" | |
description: "This task allows you to certify that you cloud works" | |
<abbility_to_extend_with_new_keys>: <and_values> | |
tasks: | |
- | |
title: "First task to execute" | |
description: "We will use " | |
scenario: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
NovaServers.boot_and_delete_server: | |
{% for i in range(10) %} | |
- | |
args: | |
flavor: | |
name: "m1.nano" | |
image: | |
name: "^cirros.*uec$" | |
force_delete: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dummy.dummy_exception: | |
- | |
args: | |
size_of_message: 5 | |
runner: | |
type: "constant" | |
times: 20 | |
concurrency: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_quotes(logical_line): | |
"""Raise lint error when using ' instead of " """ | |
# if there is no double quote sign there's nothing to do | |
if not logical_line or logical_line.strip().startswith("#"): | |
return | |
in_string = False | |
single_quotas_are_used = False | |
i = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"total_size": 173, | |
"start": 0, | |
"next_collection_link": "https://blueprints.launchpad.net/api/devel/rally/all_specifications?ws.size=75&memo=75&ws.start=75", | |
"entries": [ | |
{ | |
"starter_link": "https://blueprints.launchpad.net/api/devel/~boris-42", | |
"linked_branches_collection_link": "https://blueprints.launchpad.net/api/devel/rally/+spec/api-base/linked_branches", | |
"lifecycle_status": "Started", | |
"title": "Base for all REST API stuff", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from oslo_utils import reflection | |
REPEAT = 1000000 | |
RANGE = range(REPEAT) | |
class A(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from rally import consts | |
from rally import exceptions | |
from rally.task import context | |
@context.configure(name="sleep_context", order=100500) | |
class SleepContext(context.Context): | |
"""Dummy context.""" |