Update hacking for Python3

The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found by updated hacking version.

Remove hacking and friends from lower-constraints, they are not needed
there.

Change-Id: I14aee6250d80b7485c5c582a20abf4efafcc28c2
This commit is contained in:
Andreas Jaeger 2020-03-31 22:05:14 +02:00
parent 2504eeda60
commit a09afa37b0
6 changed files with 30 additions and 12 deletions

View File

@ -1,4 +1,14 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# 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.
import os
import sys

View File

@ -15,11 +15,9 @@ dogpile.cache==0.6.2
dulwich==0.15.0
extras==1.0.0
fixtures==3.0.0
flake8==2.5.5
future==0.16.0
gitdb==0.6.4
GitPython==1.0.1
hacking==1.1.0
imagesize==0.7.1
iso8601==0.1.11
Jinja2==2.10
@ -48,7 +46,6 @@ oslo.serialization==2.18.0
oslo.utils==3.33.0
oslotest==3.2.0
pbr==2.0.0
pep8==1.5.7
prettytable==0.7.2
pyflakes==0.8.1
Pygments==2.2.0

View File

@ -114,5 +114,6 @@ def main(args=None):
print(e)
sys.exit(1)
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))

View File

@ -1195,10 +1195,10 @@ def do_alarm_update(mc, args):
fields = {}
fields['alarm_id'] = args.id
if args.state.upper() not in state_types:
errmsg = ('Invalid state, not one of [' +
', '.join(state_types) + ']')
print(errmsg)
return
errmsg = ('Invalid state, not one of [' +
', '.join(state_types) + ']')
print(errmsg)
return
fields['state'] = args.state
fields['lifecycle_state'] = args.lifecycle_state
fields['link'] = args.link
@ -1257,8 +1257,8 @@ def do_alarm_delete(mc, args):
def output_alarm_history(args, alarm_history):
if args.json:
print(utils.json_formatter(alarm_history))
return
print(utils.json_formatter(alarm_history))
return
# format output
cols = ['alarm_id', 'new_state', 'old_state', 'reason',
'reason_data', 'metric_name', 'metric_dimensions', 'timestamp']

View File

@ -1,4 +1,14 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# 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.
# -- General configuration ------------------------------------------------

View File

@ -2,7 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=1.1.0,<1.2.0 # Apache-2.0
hacking>=3.0,<3.1.0 # Apache-2.0
bandit>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0