summaryrefslogtreecommitdiff
path: root/openstackclient/compute/v2/console.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/compute/v2/console.py')
-rw-r--r--openstackclient/compute/v2/console.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/openstackclient/compute/v2/console.py b/openstackclient/compute/v2/console.py
index 8f49c513..032168b9 100644
--- a/openstackclient/compute/v2/console.py
+++ b/openstackclient/compute/v2/console.py
@@ -55,9 +55,13 @@ class ShowConsoleLog(command.Command):
compute_client.servers,
parsed_args.server,
)
- # NOTE(dtroyer): get_console_output() appears to shortchange the
- # output by one line
- data = server.get_console_output(length=parsed_args.lines + 1)
+ length = parsed_args.lines
+ if length:
+ # NOTE(dtroyer): get_console_output() appears to shortchange the
+ # output by one line
+ length += 1
+
+ data = server.get_console_output(length=length)
sys.stdout.write(data)
return