Skip to content

Commit 3b57117

Browse files
author
Yejia Xu
committed
Display all server log when --lines option is None
Without --lines option, `console log show xxx` cmd will break. Change-Id: I4027aacac245e6916c1808fd9f878fb708c8a5f0 Closes-Bug: #1316870
1 parent 834867b commit 3b57117

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎openstackclient/compute/v2/console.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ def take_action(self, parsed_args):
5555
compute_client.servers,
5656
parsed_args.server,
5757
)
58-
# NOTE(dtroyer): get_console_output() appears to shortchange the
59-
# output by one line
60-
data = server.get_console_output(length=parsed_args.lines + 1)
58+
length = parsed_args.lines
59+
if length:
60+
# NOTE(dtroyer): get_console_output() appears to shortchange the
61+
# output by one line
62+
length += 1
63+
64+
data = server.get_console_output(length=length)
6165
sys.stdout.write(data)
6266
return
6367

0 commit comments

Comments
 (0)