Browse Source

Flush confirmation messages

Confirmation messages for cluster, profile, policy, receiver and node
deletions are printed using sys.stdout.write.  However sys.stdout.write
output is line-buffered [1].  Since the confirmation message does not
contain a newline, the message may not appear in the user's terminal.

[1] https://docs.python.org/3/library/sys.html#sys.stdout

Change-Id: I829811df362bcfd7d074523958d2aa5232da6f09
Closes-Bug: 1861042
tags/2.0.1^0
Duc Truong 6 months ago
parent
commit
d9430360be
5 changed files with 5 additions and 0 deletions
  1. +1
    -0
      senlinclient/v1/cluster.py
  2. +1
    -0
      senlinclient/v1/node.py
  3. +1
    -0
      senlinclient/v1/policy.py
  4. +1
    -0
      senlinclient/v1/profile.py
  5. +1
    -0
      senlinclient/v1/receiver.py

+ 1
- 0
senlinclient/v1/cluster.py View File

@@ -345,6 +345,7 @@ class DeleteCluster(command.Command):
sys.stdout.write(
_("Are you sure you want to delete this cluster(s)"
" [y/N]?"))
sys.stdout.flush()
prompt_response = sys.stdin.readline().lower()
if not prompt_response.startswith('y'):
return


+ 1
- 0
senlinclient/v1/node.py View File

@@ -331,6 +331,7 @@ class DeleteNode(command.Command):
sys.stdout.write(
_("Are you sure you want to delete this node(s)"
" [y/N]?"))
sys.stdout.flush()
prompt_response = sys.stdin.readline().lower()
if not prompt_response.startswith('y'):
return


+ 1
- 0
senlinclient/v1/policy.py View File

@@ -241,6 +241,7 @@ class DeletePolicy(command.Command):
sys.stdout.write(
_("Are you sure you want to delete this policy(s)"
" [y/N]?"))
sys.stdout.flush()
prompt_response = sys.stdin.readline().lower()
if not prompt_response.startswith('y'):
return


+ 1
- 0
senlinclient/v1/profile.py View File

@@ -176,6 +176,7 @@ class DeleteProfile(command.Command):
sys.stdout.write(
_("Are you sure you want to delete this profile(s)"
" [y/N]?"))
sys.stdout.flush()
prompt_response = sys.stdin.readline().lower()
if not prompt_response.startswith('y'):
return


+ 1
- 0
senlinclient/v1/receiver.py View File

@@ -294,6 +294,7 @@ class DeleteReceiver(command.Command):
sys.stdout.write(
_("Are you sure you want to delete this receiver(s)"
" [y/N]?"))
sys.stdout.flush()
prompt_response = sys.stdin.readline().lower()
if not prompt_response.startswith('y'):
return


Loading…
Cancel
Save