Update hacking version

Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I61f95439c6d79cd7bcc15badb729e4b8278cf37e
This commit is contained in:
jacky06 2019-01-04 23:26:15 +08:00
parent 145e78516c
commit 47a8febdbc
3 changed files with 17 additions and 15 deletions

View File

@ -2,7 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking<0.11,>=0.10.0 hacking>=1.1.0,<1.2.0 # Apache-2.0
coverage>=3.6 coverage>=3.6
ddt>=0.7.0 ddt>=0.7.0
mock>=1.2 mock>=1.2

View File

@ -50,7 +50,9 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
[flake8] [flake8]
show-source = True show-source = True
# F405 TEMPLATES may be undefined, or defined from star imports
# (because it is not easy to avoid this in openstack_dashboard.test.settings)
# H405 multi line docstring summary not separated with an empty line # H405 multi line docstring summary not separated with an empty line
ignore = H405 ignore = F405,H405
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject,tools,releasenotes,.tmp exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject,tools,releasenotes,.tmp

View File

@ -84,9 +84,9 @@ class RestartInstance(tables.BatchAction):
classes = ('btn-danger', 'btn-reboot') classes = ('btn-danger', 'btn-reboot')
def allowed(self, request, instance=None): def allowed(self, request, instance=None):
return ((instance.status in ACTIVE_STATES return ((instance.status in ACTIVE_STATES or
or instance.status == 'SHUTDOWN' instance.status == 'SHUTDOWN' or
or instance.status == 'RESTART_REQUIRED')) instance.status == 'RESTART_REQUIRED'))
def action(self, request, obj_id): def action(self, request, obj_id):
api.trove.instance_restart(request, obj_id) api.trove.instance_restart(request, obj_id)
@ -113,8 +113,8 @@ class DetachReplica(tables.BatchAction):
classes = ('btn-danger', 'btn-detach-replica') classes = ('btn-danger', 'btn-detach-replica')
def allowed(self, request, instance=None): def allowed(self, request, instance=None):
return (instance.status in ACTIVE_STATES return (instance.status in ACTIVE_STATES and
and hasattr(instance, 'replica_of')) hasattr(instance, 'replica_of'))
def action(self, request, obj_id): def action(self, request, obj_id):
api.trove.instance_detach_replica(request, obj_id) api.trove.instance_detach_replica(request, obj_id)
@ -127,8 +127,8 @@ class PromoteToReplicaSource(tables.LinkAction):
classes = ("ajax-modal", "btn-promote-to-replica-source") classes = ("ajax-modal", "btn-promote-to-replica-source")
def allowed(self, request, instance=None): def allowed(self, request, instance=None):
return (instance.status in ACTIVE_STATES return (instance.status in ACTIVE_STATES and
and hasattr(instance, 'replica_of')) hasattr(instance, 'replica_of'))
def get_link_url(self, datum): def get_link_url(self, datum):
instance_id = self.table.get_object_id(datum) instance_id = self.table.get_object_id(datum)
@ -156,8 +156,8 @@ class EjectReplicaSource(tables.BatchAction):
classes = ('btn-danger', 'btn-eject-replica-source') classes = ('btn-danger', 'btn-eject-replica-source')
def _allowed(self, request, instance=None): def _allowed(self, request, instance=None):
return (instance.status != 'PROMOTE' return (instance.status != 'PROMOTE' and
and hasattr(instance, 'replicas')) hasattr(instance, 'replicas'))
def action(self, request, obj_id): def action(self, request, obj_id):
api.trove.eject_replica_source(request, obj_id) api.trove.eject_replica_source(request, obj_id)
@ -436,8 +436,8 @@ class ResizeInstance(tables.LinkAction):
classes = ("ajax-modal", "btn-resize") classes = ("ajax-modal", "btn-resize")
def allowed(self, request, instance=None): def allowed(self, request, instance=None):
return ((instance.status in ACTIVE_STATES return ((instance.status in ACTIVE_STATES or
or instance.status == 'SHUTOFF')) instance.status == 'SHUTOFF'))
def get_link_url(self, datum): def get_link_url(self, datum):
instance_id = self.table.get_object_id(datum) instance_id = self.table.get_object_id(datum)
@ -451,8 +451,8 @@ class AttachConfiguration(tables.LinkAction):
classes = ("btn-attach-config", "ajax-modal") classes = ("btn-attach-config", "ajax-modal")
def allowed(self, request, instance=None): def allowed(self, request, instance=None):
return (instance.status in ACTIVE_STATES return (instance.status in ACTIVE_STATES and
and not hasattr(instance, 'configuration')) not hasattr(instance, 'configuration'))
class DetachConfiguration(tables.BatchAction): class DetachConfiguration(tables.BatchAction):