[CI] Update hacking and fix pep8 errors

Recent release of pbr 2.0.0 requires us to update hacking in
rally requirements.

* Added missing new lines at the end of files
* Skipped H105 (Don't use author tags). These lines cannot be
  removed without an agreement with the author.

Change-Id: Iac581ea4ded8ef85cd8a5bc204ac0c4436088eb6
This commit is contained in:
Anton Studenov 2017-03-02 10:55:30 +03:00
parent 9fa3c3b5ba
commit 51e093f92b
28 changed files with 28 additions and 29 deletions

View File

@ -178,4 +178,4 @@ class ValidateMonasca(scenario.OpenStackScenario):
self,
"authenticate.validate_monasca_%s_times" % repetitions):
for i in range(repetitions):
list(monasca_client.metrics.list(limit=0))
list(monasca_client.metrics.list(limit=0))

View File

@ -65,4 +65,4 @@ class ListMatchedMeters(ceiloutils.CeilometerScenario):
filter_by_user_id,
filter_by_resource_id,
metadata_query)
self._list_meters(query, limit)
self._list_meters(query, limit)

View File

@ -98,4 +98,4 @@ class ListMatchedResources(ceiloutils.CeilometerScenario):
filter_by_resource_id,
metadata_query)
query += self._make_timestamp_query(start_time, end_time)
self._list_resources(query, limit)
self._list_resources(query, limit)

View File

@ -64,4 +64,4 @@ class ListSamples(ceiloutils.CeilometerScenario):
if metadata_query:
scenario.run(metadata_query=metadata_query)
if limit:
scenario.run(limit=limit)
scenario.run(limit=limit)

View File

@ -70,4 +70,4 @@ class GetStats(utils.CeilometerScenario):
filter_by_user_id,
filter_by_resource_id,
metadata_query)
self._get_stats(meter_name, query, period, groupby, aggregates)
self._get_stats(meter_name, query, period, groupby, aggregates)

View File

@ -68,4 +68,4 @@ class CreateUserAndListTraitDescriptions(
"""
self.admin_keystone.create_user()
event = self._list_events()[0]
self._list_event_trait_descriptions(event_type=event.event_type)
self._list_event_trait_descriptions(event_type=event.event_type)

View File

@ -55,4 +55,4 @@ class BootServer(utils.EC2Scenario):
:param flavor: flavor to be used to boot an instance
:param kwargs: optional additional arguments for server creation
"""
self._boot_servers(image, flavor, **kwargs)
self._boot_servers(image, flavor, **kwargs)

View File

@ -82,4 +82,4 @@ class CreateAndDeleteNode(utils.IronicScenario):
:param kwargs: Optional additional arguments for node creation
"""
node = self._create_node(**kwargs)
self._delete_node(node.uuid)
self._delete_node(node.uuid)

View File

@ -76,4 +76,4 @@ class CreateAndDeployEnvironment(utils.MuranoScenario):
package.fully_qualified_name,
atomic_action=False)
self._deploy_environment(environment, session)
self._deploy_environment(environment, session)

View File

@ -154,4 +154,4 @@ class ImportAndFilterApplications(utils.MuranoScenario):
self._import_package(package_path)
self._filter_applications(filter_query)
finally:
os.remove(package_path)
os.remove(package_path)

View File

@ -270,4 +270,4 @@ class CreateAndUpdateHealthmonitors(utils.NeutronScenario):
healthmonitor = self._create_v1_healthmonitor(
**healthmonitor_create_args)
self._update_v1_healthmonitor(healthmonitor,
**healthmonitor_update_args)
**healthmonitor_update_args)

View File

@ -86,4 +86,4 @@ class CreateAndUpdateSecurityGroups(utils.NeutronScenario):
security_group = self._create_security_group(
**security_group_create_args)
self._update_security_group(security_group,
**security_group_update_args)
**security_group_update_args)

View File

@ -100,4 +100,4 @@ class BootAndDeleteServerWithKeypair(utils.NovaScenario):
key_name=keypair,
**boot_server_kwargs)
self._delete_server(server)
self._delete_keypair(keypair)
self._delete_keypair(keypair)

View File

@ -224,4 +224,4 @@ class CreateScaleDeleteCluster(utils.SaharaScenario):
elif delta < 0:
self._scale_cluster_down(cluster, delta)
self._delete_cluster(cluster)
self._delete_cluster(cluster)

View File

@ -135,4 +135,4 @@ class CreateLaunchJobSequenceWithScaling(utils.SaharaScenario,):
self._scale_cluster_down(cluster, delta)
LOG.debug("Starting Job sequence")
launch_job_sequence.run(jobs)
launch_job_sequence.run(jobs)

View File

@ -110,4 +110,4 @@ class CreateDeleteNodeGroupTemplates(utils.SaharaScenario):
use_autoconfig=use_autoconfig)
self._delete_node_group_template(master_ngt)
self._delete_node_group_template(worker_ngt)
self._delete_node_group_template(worker_ngt)

View File

@ -45,4 +45,4 @@ class CreateAndDeleteCluster(utils.SenlinScenario):
profile_id = self.context["tenant"]["profile"]
cluster = self._create_cluster(profile_id, desired_capacity,
min_size, max_size, timeout, metadata)
self._delete_cluster(cluster)
self._delete_cluster(cluster)

View File

@ -188,4 +188,4 @@ class ListAndDownloadObjectsInContainers(utils.SwiftScenario):
for container_name, objects in objects_dict.items():
for obj in objects:
self._download_object(container_name, obj["name"],
atomic_action=False)
atomic_action=False)

View File

@ -93,4 +93,4 @@ class CreateAuditAndDelete(utils.WatcherScenario):
audit_template_uuid = self.context["audit_templates"][0]
audit = self._create_audit(audit_template_uuid)
self._delete_audit(audit)
self._delete_audit(audit)

View File

@ -64,4 +64,4 @@ class ProducerConsumer(zutils.ZaqarScenario):
in range(msg_count)]
self._messages_post(queue, messages, min_msg_count, max_msg_count)
self._messages_list(queue)
self._queue_delete(queue)
self._queue_delete(queue)

View File

@ -238,4 +238,4 @@ class WatcherGoal(types.ResourceType):
resource_config.get("name"))],
typename="goal",
id_attr="uuid")
return resource_id
return resource_id

View File

@ -2,8 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
# [do-not-touch] we need to modify our code to support latest release
hacking>=0.9.2,<0.10 # Apache Software License
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
pytest>=2.7,<=3.0.6 # MIT
# py.test plugin for measuring coverage.

View File

@ -324,4 +324,4 @@ class HeatStacksTestCase(test.ScenarioTestCase):
self.default_template, self.default_parameters,
self.default_files, self.default_environment)
mock__stack_list_output.assert_called_once_with(
mock__create_stack.return_value)
mock__create_stack.return_value)

View File

@ -153,4 +153,4 @@ class MistralScenarioTestCase(test.ScenarioTestCase):
self._test_atomic_action_timer(
scenario.atomic_actions(),
"mistral.delete_execution"
)
)

View File

@ -52,4 +52,4 @@ class MistralWorkbooksTestCase(test.ScenarioTestCase):
self.assertTrue(mock_create_workbook__create_workbook.called)
mock_create_workbook__delete_workbook.assert_called_once_with(
fake_wb.name)
fake_wb.name)

View File

@ -83,4 +83,4 @@ class MuranoPackagesTestCase(test.TestCase):
scenario._zip_package.return_value)
scenario._filter_applications.assert_called_once_with(
{"category": "Web"}
)
)

View File

@ -73,4 +73,4 @@ class PyTestLauncherTestCase(test.TestCase):
self.assertEqual(1, self.sp.check_call.call_count)
call_args_obj = self.sp.check_call.call_args_list[0]
call_args = call_args_obj[0]
self.assertEqual(expected_path, call_args[0][-1])
self.assertEqual(expected_path, call_args[0][-1])

View File

@ -76,7 +76,7 @@ deps = requests[security]
commands = python {toxinidir}/tests/ci/sync_requirements.py {posargs}
[flake8]
ignore = H703
ignore = H703,H105
show-source = true
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,build,setup.py