diff --git a/doc/source/ext/gen_ref.py b/doc/source/ext/gen_ref.py index cbe936ba..a5071887 100644 --- a/doc/source/ext/gen_ref.py +++ b/doc/source/ext/gen_ref.py @@ -53,6 +53,7 @@ def gen_ref(ver, title, names): "signs": "=" * len(sec_title), "pkg": pkg, "name": name}) + gen_ref("", "Client Reference", {"client": "Client", "exc": "Exceptions"}) gen_ref("v1", "Version 1 API Reference", {"stacks": "Stacks", diff --git a/heatclient/common/event_utils.py b/heatclient/common/event_utils.py index 8551b56c..c4095b6a 100644 --- a/heatclient/common/event_utils.py +++ b/heatclient/common/event_utils.py @@ -182,9 +182,9 @@ def poll_for_events(hc, stack_name, action=None, poll_period=5, marker=None, if action: stop_status = ('%s_FAILED' % action, '%s_COMPLETE' % action) - stop_check = lambda a: a in stop_status + stop_check = lambda a: a in stop_status # noqa: E731 else: - stop_check = lambda a: a.endswith('_COMPLETE') or a.endswith('_FAILED') + stop_check = lambda a: a.endswith('_COMPLETE') or a.endswith('_FAILED') # noqa E731 no_event_polls = 0 msg_template = _("\n Stack %(name)s %(status)s \n") diff --git a/heatclient/common/http.py b/heatclient/common/http.py index 1f86c241..3a85bc5c 100644 --- a/heatclient/common/http.py +++ b/heatclient/common/http.py @@ -340,7 +340,7 @@ class SessionClient(adapter.LegacyJsonAdapter): raise exc.InvalidEndpoint(message=message) if (self.endpoint_override is not None and location.lower().startswith(self.endpoint_override.lower())): - return location[len(self.endpoint_override):] + return location[len(self.endpoint_override):] else: return location diff --git a/heatclient/common/template_format.py b/heatclient/common/template_format.py index fb275f6a..6aaf1e01 100644 --- a/heatclient/common/template_format.py +++ b/heatclient/common/template_format.py @@ -39,6 +39,8 @@ def _construct_yaml_str(self, node): # Override the default string handling function # to always return unicode objects return self.construct_scalar(node) + + yaml_loader.add_constructor(u'tag:yaml.org,2002:str', _construct_yaml_str) # Unquoted dates like 2013-05-23 in yaml files get loaded as objects of type # datetime.data which causes problems in API layer when being processed by diff --git a/heatclient/common/utils.py b/heatclient/common/utils.py index ae325147..cb2cb886 100644 --- a/heatclient/common/utils.py +++ b/heatclient/common/utils.py @@ -377,8 +377,8 @@ def format_parameter_file(param_files, template_file=None, param_file = {} for key, value in params.items(): - param_file[key] = resolve_param_get_file(value, - template_base_url) + param_file[key] = resolve_param_get_file(value, + template_base_url) return param_file diff --git a/heatclient/shell.py b/heatclient/shell.py index b36c29f2..b5272742 100644 --- a/heatclient/shell.py +++ b/heatclient/shell.py @@ -615,5 +615,6 @@ def main(args=None): print(encodeutils.safe_encode(six.text_type(e)), file=sys.stderr) sys.exit(1) + if __name__ == "__main__": main() diff --git a/heatclient/tests/unit/test_deployment_utils.py b/heatclient/tests/unit/test_deployment_utils.py index 2f9c6379..1167a769 100644 --- a/heatclient/tests/unit/test_deployment_utils.py +++ b/heatclient/tests/unit/test_deployment_utils.py @@ -291,9 +291,9 @@ class TempURLSignalTest(testtools.TestCase): '[a-f0-9]{3}-[a-f0-9]{12}') url = deployment_utils.create_temp_url(swift_client, 'bar', 60) self.assertFalse(swift_client.post_account.called) - regexp = ("http://fake-host.com:8080/v1/AUTH_demo/bar-%s" - "/%s\?temp_url_sig=[0-9a-f]{40}&" - "temp_url_expires=[0-9]{10}" % (uuid_pattern, uuid_pattern)) + regexp = (r"http://fake-host.com:8080/v1/AUTH_demo/bar-%s" + r"/%s\?temp_url_sig=[0-9a-f]{40}&" + r"temp_url_expires=[0-9]{10}" % (uuid_pattern, uuid_pattern)) self.assertThat(url, matchers.MatchesRegex(regexp)) timeout = int(url.split('=')[-1]) diff --git a/heatclient/tests/unit/test_shell.py b/heatclient/tests/unit/test_shell.py index fcb019c1..0c8b272b 100644 --- a/heatclient/tests/unit/test_shell.py +++ b/heatclient/tests/unit/test_shell.py @@ -557,7 +557,7 @@ class ShellTestNoMox(ShellTestNoMoxBase): template_file = os.path.join(TEST_VAR_DIR, 'minimal.template') self.shell_error('stack-create -f %s stack' % template_file, - 'The Parameter \(key_name\) was not provided.', + r'The Parameter \(key_name\) was not provided.', exception=exc.HTTPBadRequest) def test_event_list(self): @@ -2437,7 +2437,7 @@ class ShellTestUserPass(ShellBase): '{', '"output_key": "output2"', '"description": "test output 2"', - '"output_value": \[', + r'"output_value": \[', '"output"', '"value"', '"2"', diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index dad05687..04ebf446 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -728,7 +728,7 @@ def do_output_list(hc, args): utils.print_list(outputs['outputs'], fields, formatters=formatters) -@utils.arg('id', metavar='', +@utils.arg('id', metavar='', # noqa: C901 help=_('Name or ID of stack to query.')) @utils.arg('output', metavar='', nargs='?', default=None, help=_('Name of an output to display.')) diff --git a/test-requirements.txt b/test-requirements.txt index 4f6c9a32..6173b050 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,7 @@ # process, which may cause wedges in the gate later. # Hacking already pins down pep8, pyflakes and flake8 -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=3.0,<3.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD requests-mock>=1.2.0 # Apache-2.0