From 2266438303c1ebfb43ce43142aa3670d65e6ffb4 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 3 Nov 2020 11:14:49 -0500 Subject: [PATCH] Show fewer lines on a log follow --- client-cli/pvc.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client-cli/pvc.py b/client-cli/pvc.py index 8b1e637c..4b79daf4 100755 --- a/client-cli/pvc.py +++ b/client-cli/pvc.py @@ -1001,8 +1001,8 @@ def vm_flush_locks(domain): 'domain' ) @click.option( - '-l', '--lines', 'lines', default=1000, show_default=True, - help='Display this many log lines from the end of the log buffer.' + '-l', '--lines', 'lines', default=None, show_default=False, + help='Display this many log lines from the end of the log buffer. [default: 1000]' ) @click.option( '-f', '--follow', 'follow', is_flag=True, default=False, @@ -1014,6 +1014,13 @@ def vm_log(domain, lines, follow): Show console logs of virtual machine DOMAIN on its current node in a pager or continuously. DOMAIN may be a UUID or name. Note that migrating a VM to a different node will cause the log buffer to be overwritten by entries from the new node. """ + # Set the default here so we can handle it + if lines is None: + if follow: + lines = 10 + else: + lines = 1000 + if follow: retcode, retmsg = pvc_vm.follow_console_log(config, domain, lines) else: