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
This commit is contained in:
parent
6d2ad89b1f
commit
d9430360be
@ -345,6 +345,7 @@ class DeleteCluster(command.Command):
|
|||||||
sys.stdout.write(
|
sys.stdout.write(
|
||||||
_("Are you sure you want to delete this cluster(s)"
|
_("Are you sure you want to delete this cluster(s)"
|
||||||
" [y/N]?"))
|
" [y/N]?"))
|
||||||
|
sys.stdout.flush()
|
||||||
prompt_response = sys.stdin.readline().lower()
|
prompt_response = sys.stdin.readline().lower()
|
||||||
if not prompt_response.startswith('y'):
|
if not prompt_response.startswith('y'):
|
||||||
return
|
return
|
||||||
|
@ -331,6 +331,7 @@ class DeleteNode(command.Command):
|
|||||||
sys.stdout.write(
|
sys.stdout.write(
|
||||||
_("Are you sure you want to delete this node(s)"
|
_("Are you sure you want to delete this node(s)"
|
||||||
" [y/N]?"))
|
" [y/N]?"))
|
||||||
|
sys.stdout.flush()
|
||||||
prompt_response = sys.stdin.readline().lower()
|
prompt_response = sys.stdin.readline().lower()
|
||||||
if not prompt_response.startswith('y'):
|
if not prompt_response.startswith('y'):
|
||||||
return
|
return
|
||||||
|
@ -241,6 +241,7 @@ class DeletePolicy(command.Command):
|
|||||||
sys.stdout.write(
|
sys.stdout.write(
|
||||||
_("Are you sure you want to delete this policy(s)"
|
_("Are you sure you want to delete this policy(s)"
|
||||||
" [y/N]?"))
|
" [y/N]?"))
|
||||||
|
sys.stdout.flush()
|
||||||
prompt_response = sys.stdin.readline().lower()
|
prompt_response = sys.stdin.readline().lower()
|
||||||
if not prompt_response.startswith('y'):
|
if not prompt_response.startswith('y'):
|
||||||
return
|
return
|
||||||
|
@ -176,6 +176,7 @@ class DeleteProfile(command.Command):
|
|||||||
sys.stdout.write(
|
sys.stdout.write(
|
||||||
_("Are you sure you want to delete this profile(s)"
|
_("Are you sure you want to delete this profile(s)"
|
||||||
" [y/N]?"))
|
" [y/N]?"))
|
||||||
|
sys.stdout.flush()
|
||||||
prompt_response = sys.stdin.readline().lower()
|
prompt_response = sys.stdin.readline().lower()
|
||||||
if not prompt_response.startswith('y'):
|
if not prompt_response.startswith('y'):
|
||||||
return
|
return
|
||||||
|
@ -294,6 +294,7 @@ class DeleteReceiver(command.Command):
|
|||||||
sys.stdout.write(
|
sys.stdout.write(
|
||||||
_("Are you sure you want to delete this receiver(s)"
|
_("Are you sure you want to delete this receiver(s)"
|
||||||
" [y/N]?"))
|
" [y/N]?"))
|
||||||
|
sys.stdout.flush()
|
||||||
prompt_response = sys.stdin.readline().lower()
|
prompt_response = sys.stdin.readline().lower()
|
||||||
if not prompt_response.startswith('y'):
|
if not prompt_response.startswith('y'):
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user