From 973e16960d3d8054e3d6b367033ea975900741c0 Mon Sep 17 00:00:00 2001 From: David Hill Date: Tue, 10 May 2022 12:28:43 -0400 Subject: [PATCH] Do not output log on bash autocomplete generation Do not output log on bash autocomplete generation as it requires manual sanitizing. For instance, when running `openstack complete`, it appends the following two lines: ~~~ complete -F _openstack openstack 2022-05-10 12:50:25.052 863 INFO osc_lib.shell [-] END return value: 0 ~~~ and in the current .spec file, we manually remove the `complete -F` line but we still get that LOG.info output in train at least. This behavior was not seen on master/wallaby. Change-Id: Id99791831ffc145b10a0ec8c211a99f8a714fa0a --- osc_lib/shell.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osc_lib/shell.py b/osc_lib/shell.py index 5d673d3..ec8e55c 100644 --- a/osc_lib/shell.py +++ b/osc_lib/shell.py @@ -144,7 +144,8 @@ class OpenStackShell(app.App): return ret_val finally: - self.log.info("END return value: %s", ret_val) + if 'complete' not in argv: + self.log.info("END return value: %s", ret_val) def init_profile(self): self.do_profile = osprofiler_profiler and self.options.profile