Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8 Change-Id: If1860c3fe287852e87704b511567c65d8d4d0c1c
This commit is contained in:
parent
7dbd8ab34b
commit
a4d31eac42
@ -5,7 +5,7 @@
|
|||||||
coverage>=4.5.1 # Apache-2.0
|
coverage>=4.5.1 # Apache-2.0
|
||||||
doc8>=0.8.0 # Apache-2.0
|
doc8>=0.8.0 # Apache-2.0
|
||||||
freezegun>=0.3.10 # Apache-2.0
|
freezegun>=0.3.10 # Apache-2.0
|
||||||
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
hacking>=1.1.0,<1.2.0 # Apache-2.0
|
||||||
mock>=2.0.0 # BSD
|
mock>=2.0.0 # BSD
|
||||||
oslotest>=3.3.0 # Apache-2.0
|
oslotest>=3.3.0 # Apache-2.0
|
||||||
os-testr>=1.0.0 # Apache-2.0
|
os-testr>=1.0.0 # Apache-2.0
|
||||||
|
2
tox.ini
2
tox.ini
@ -72,7 +72,7 @@ commands =
|
|||||||
[flake8]
|
[flake8]
|
||||||
filename = *.py,app.wsgi
|
filename = *.py,app.wsgi
|
||||||
show-source=True
|
show-source=True
|
||||||
ignore= H105,E123,E226,N320,H202
|
ignore= H105,E123,E226,E731,N320,H202
|
||||||
builtins= _
|
builtins= _
|
||||||
enable-extensions = H106,H203,H904
|
enable-extensions = H106,H203,H904
|
||||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,*sqlalchemy/alembic/versions/*,demo/,releasenotes
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,*sqlalchemy/alembic/versions/*,demo/,releasenotes
|
||||||
|
@ -123,8 +123,8 @@ class AuditPostType(wtypes.Base):
|
|||||||
'or goal should be provided.')
|
'or goal should be provided.')
|
||||||
|
|
||||||
if (self.audit_type == objects.audit.AuditType.ONESHOT.value and
|
if (self.audit_type == objects.audit.AuditType.ONESHOT.value and
|
||||||
(self.start_time not in (wtypes.Unset, None)
|
(self.start_time not in (wtypes.Unset, None) or
|
||||||
or self.end_time not in (wtypes.Unset, None))):
|
self.end_time not in (wtypes.Unset, None))):
|
||||||
raise exception.AuditStartEndTimeNotAllowed(
|
raise exception.AuditStartEndTimeNotAllowed(
|
||||||
audit_type=self.audit_type)
|
audit_type=self.audit_type)
|
||||||
|
|
||||||
|
@ -69,8 +69,8 @@ class Service(base.APIBase):
|
|||||||
|
|
||||||
def _set_status(self, id):
|
def _set_status(self, id):
|
||||||
service = objects.Service.get(pecan.request.context, id)
|
service = objects.Service.get(pecan.request.context, id)
|
||||||
last_heartbeat = (service.last_seen_up or service.updated_at
|
last_heartbeat = (service.last_seen_up or service.updated_at or
|
||||||
or service.created_at)
|
service.created_at)
|
||||||
if isinstance(last_heartbeat, six.string_types):
|
if isinstance(last_heartbeat, six.string_types):
|
||||||
# NOTE(russellb) If this service came in over rpc via
|
# NOTE(russellb) If this service came in over rpc via
|
||||||
# conductor, then the timestamp will be a string and needs to be
|
# conductor, then the timestamp will be a string and needs to be
|
||||||
|
@ -82,8 +82,8 @@ class APISchedulingService(scheduling.BackgroundSchedulerService):
|
|||||||
|
|
||||||
def get_service_status(self, context, service_id):
|
def get_service_status(self, context, service_id):
|
||||||
service = objects.Service.get(context, service_id)
|
service = objects.Service.get(context, service_id)
|
||||||
last_heartbeat = (service.last_seen_up or service.updated_at
|
last_heartbeat = (service.last_seen_up or service.updated_at or
|
||||||
or service.created_at)
|
service.created_at)
|
||||||
if isinstance(last_heartbeat, six.string_types):
|
if isinstance(last_heartbeat, six.string_types):
|
||||||
# NOTE(russellb) If this service came in over rpc via
|
# NOTE(russellb) If this service came in over rpc via
|
||||||
# conductor, then the timestamp will be a string and needs to be
|
# conductor, then the timestamp will be a string and needs to be
|
||||||
|
@ -100,9 +100,9 @@ class HardwareMaintenance(base.EfficacySpecification):
|
|||||||
if (indicators_map and
|
if (indicators_map and
|
||||||
indicators_map.planned_live_migrate_instance_count > 0):
|
indicators_map.planned_live_migrate_instance_count > 0):
|
||||||
li_value = (
|
li_value = (
|
||||||
float(indicators_map.planned_live_migrate_instance_count)
|
float(indicators_map.planned_live_migrate_instance_count) /
|
||||||
/ float(indicators_map.live_migrate_instance_count)
|
float(indicators_map.live_migrate_instance_count) *
|
||||||
* 100
|
100
|
||||||
)
|
)
|
||||||
|
|
||||||
li_indicator = efficacy.Indicator(
|
li_indicator = efficacy.Indicator(
|
||||||
@ -116,9 +116,9 @@ class HardwareMaintenance(base.EfficacySpecification):
|
|||||||
if (indicators_map and
|
if (indicators_map and
|
||||||
indicators_map.planned_cold_migrate_instance_count > 0):
|
indicators_map.planned_cold_migrate_instance_count > 0):
|
||||||
ci_value = (
|
ci_value = (
|
||||||
float(indicators_map.planned_cold_migrate_instance_count)
|
float(indicators_map.planned_cold_migrate_instance_count) /
|
||||||
/ float(indicators_map.cold_migrate_instance_count)
|
float(indicators_map.cold_migrate_instance_count) *
|
||||||
* 100
|
100
|
||||||
)
|
)
|
||||||
|
|
||||||
ci_indicator = efficacy.Indicator(
|
ci_indicator = efficacy.Indicator(
|
||||||
@ -133,8 +133,8 @@ class HardwareMaintenance(base.EfficacySpecification):
|
|||||||
indicators_map.planned_volume_migrate_count > 0):
|
indicators_map.planned_volume_migrate_count > 0):
|
||||||
dv_value = (float(indicators_map.planned_volume_migrate_count) /
|
dv_value = (float(indicators_map.planned_volume_migrate_count) /
|
||||||
float(indicators_map.
|
float(indicators_map.
|
||||||
volume_migrate_count)
|
volume_migrate_count) *
|
||||||
* 100)
|
100)
|
||||||
|
|
||||||
dv_indicator = efficacy.Indicator(
|
dv_indicator = efficacy.Indicator(
|
||||||
name="volume_migrate_ratio",
|
name="volume_migrate_ratio",
|
||||||
@ -148,8 +148,8 @@ class HardwareMaintenance(base.EfficacySpecification):
|
|||||||
indicators_map.planned_volume_update_count > 0):
|
indicators_map.planned_volume_update_count > 0):
|
||||||
av_value = (float(indicators_map.planned_volume_update_count) /
|
av_value = (float(indicators_map.planned_volume_update_count) /
|
||||||
float(indicators_map.
|
float(indicators_map.
|
||||||
volume_update_count)
|
volume_update_count) *
|
||||||
* 100)
|
100)
|
||||||
|
|
||||||
av_indicator = efficacy.Indicator(
|
av_indicator = efficacy.Indicator(
|
||||||
name="volume_update_ratio",
|
name="volume_update_ratio",
|
||||||
|
@ -535,8 +535,8 @@ class ZoneMigration(base.ZoneMigrationBaseStrategy):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
return [i for i in self.nova.get_instance_list()
|
return [i for i in self.nova.get_instance_list()
|
||||||
if getattr(i, 'OS-EXT-SRV-ATTR:host') in src_node_list
|
if getattr(i, 'OS-EXT-SRV-ATTR:host') in src_node_list and
|
||||||
and self.compute_model.get_instance_by_uuid(i.id)]
|
self.compute_model.get_instance_by_uuid(i.id)]
|
||||||
|
|
||||||
def get_volumes(self):
|
def get_volumes(self):
|
||||||
"""Get migrate target volumes
|
"""Get migrate target volumes
|
||||||
@ -547,8 +547,8 @@ class ZoneMigration(base.ZoneMigrationBaseStrategy):
|
|||||||
src_pool_list = self.get_src_pool_list()
|
src_pool_list = self.get_src_pool_list()
|
||||||
|
|
||||||
return [i for i in self.cinder.get_volume_list()
|
return [i for i in self.cinder.get_volume_list()
|
||||||
if getattr(i, 'os-vol-host-attr:host') in src_pool_list
|
if getattr(i, 'os-vol-host-attr:host') in src_pool_list and
|
||||||
and self.storage_model.get_volume_by_uuid(i.id)]
|
self.storage_model.get_volume_by_uuid(i.id)]
|
||||||
|
|
||||||
def filtered_targets(self):
|
def filtered_targets(self):
|
||||||
"""Filter targets
|
"""Filter targets
|
||||||
|
@ -144,8 +144,8 @@ class TestNoExceptionTracebackHook(base.FunctionalTest):
|
|||||||
# rare thing (happens due to wrong deserialization settings etc.)
|
# rare thing (happens due to wrong deserialization settings etc.)
|
||||||
# we don't care about this garbage.
|
# we don't care about this garbage.
|
||||||
expected_msg = ("Remote error: %s %s"
|
expected_msg = ("Remote error: %s %s"
|
||||||
% (test_exc_type, self.MSG_WITHOUT_TRACE)
|
% (test_exc_type, self.MSG_WITHOUT_TRACE) +
|
||||||
+ ("\n[u'" if six.PY2 else "\n['"))
|
("\n[u'" if six.PY2 else "\n['"))
|
||||||
actual_msg = jsonutils.loads(
|
actual_msg = jsonutils.loads(
|
||||||
response.json['error_message'])['faultstring']
|
response.json['error_message'])['faultstring']
|
||||||
self.assertEqual(expected_msg, actual_msg)
|
self.assertEqual(expected_msg, actual_msg)
|
||||||
|
@ -550,9 +550,9 @@ class TestPatchStateTransitionDenied(api_base.FunctionalTest):
|
|||||||
# because we cannot retrieve them with a GET (soft_deleted state).
|
# because we cannot retrieve them with a GET (soft_deleted state).
|
||||||
# This is the reason why they are not listed here but they have a
|
# This is the reason why they are not listed here but they have a
|
||||||
# special test to cover it
|
# special test to cover it
|
||||||
if original_state != objects.action_plan.State.DELETED
|
if original_state != objects.action_plan.State.DELETED and
|
||||||
and original_state != new_state
|
original_state != new_state and
|
||||||
and {"original_state": original_state,
|
{"original_state": original_state,
|
||||||
"new_state": new_state} not in ALLOWED_TRANSITIONS
|
"new_state": new_state} not in ALLOWED_TRANSITIONS
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -384,8 +384,8 @@ class TestPatchStateTransitionDenied(api_base.FunctionalTest):
|
|||||||
)
|
)
|
||||||
for original_state, new_state
|
for original_state, new_state
|
||||||
in list(itertools.product(STATES, STATES))
|
in list(itertools.product(STATES, STATES))
|
||||||
if original_state != new_state
|
if original_state != new_state and
|
||||||
and {"original_state": original_state,
|
{"original_state": original_state,
|
||||||
"new_state": new_state} not in ALLOWED_TRANSITIONS
|
"new_state": new_state} not in ALLOWED_TRANSITIONS
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user