diff --git a/doc/source/conf.py b/doc/source/conf.py index 8bbe7f1..594d7d0 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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 diff --git a/lower-constraints.txt b/lower-constraints.txt index 897fce1..8fc0be0 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -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 diff --git a/monascaclient/shell.py b/monascaclient/shell.py index c79a64d..e5b949f 100644 --- a/monascaclient/shell.py +++ b/monascaclient/shell.py @@ -114,5 +114,6 @@ def main(args=None): print(e) sys.exit(1) + if __name__ == "__main__": sys.exit(main(sys.argv[1:])) diff --git a/monascaclient/v2_0/shell.py b/monascaclient/v2_0/shell.py index 8019d77..9537ec5 100644 --- a/monascaclient/v2_0/shell.py +++ b/monascaclient/v2_0/shell.py @@ -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'] diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 45f8acc..ecf849b 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -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 ------------------------------------------------ diff --git a/test-requirements.txt b/test-requirements.txt index 0b214cc..232bab2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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