Skip to content

Commit 679a90b

Browse files
committed
Fix print_banner: accept optional logger to avoid NoneType error in store
1 parent 2b7af47 commit 679a90b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

web/client/codechecker_client/cli/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ def main(args):
938938
client = libclient.setup_client(args.product_url)
939939
protocol, host, port, product_name = \
940940
product.split_product_url(args.product_url)
941-
print_banner(protocol, host, port)
941+
print_banner(protocol, host, port, LOG)
942942
prod_client = libclient.setup_product_client(protocol,
943943
host,
944944
port,

web/client/codechecker_client/cmd_line_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,11 +1829,11 @@ def get_announcement_msg(protocol, host, port):
18291829
return config_client.getNotificationBannerText()
18301830

18311831

1832-
def print_banner(protocol, host, port):
1832+
def print_banner(protocol, host, port, log=None):
18331833
"""Fetch and print the server banner if one is set."""
18341834
encoded = get_announcement_msg(protocol, host, port)
18351835
if encoded:
1836-
LOG.info("Announcement: %s", convert.from_b64(encoded))
1836+
(log or LOG).info("Announcement: %s", convert.from_b64(encoded))
18371837

18381838

18391839
def handle_login(args):

0 commit comments

Comments
 (0)