Skip to content

Commit 3f99dba

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix crashing "console log show""
2 parents 255fe68 + 9a17356 commit 3f99dba

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

openstackclient/compute/v2/console.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
"""Compute v2 Console action implementations"""
1717

18-
import sys
19-
2018
from osc_lib.cli import parseractions
2119
from osc_lib.command import command
2220
from osc_lib import utils
@@ -60,7 +58,10 @@ def take_action(self, parsed_args):
6058
length += 1
6159

6260
data = server.get_console_output(length=length)
63-
sys.stdout.write(data)
61+
62+
if data and data[-1] != '\n':
63+
data += '\n'
64+
self.app.stdout.write(data)
6465

6566

6667
class ShowConsoleURL(command.ShowOne):

0 commit comments

Comments
 (0)