samba-tool domain provision: Fix --interactive module in python3
authorAndrew Bartlett <abartlet@samba.org>
Sun, 10 Mar 2019 23:38:27 +0000 (23:38 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 12 Mar 2019 01:53:26 +0000 (01:53 +0000)
The prompts were not being printed to the screen because the stream
was not being flushed.

As reported on the samba mailing list by Adam Xu:
https://lists.samba.org/archive/samba/2019-March/221753.html

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13828

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
python/samba/netcmd/domain.py

index b7aedc16a918e587ee86044a4db0bf116eeda99a..2aebb5f8166c09ba50fdb1384e583b4992c96ef5 100644 (file)
@@ -390,6 +390,7 @@ class cmd_domain_provision(Command):
                     print("%s [%s]: " % (prompt, default), end=' ')
                 else:
                     print("%s: " % (prompt,), end=' ')
+                sys.stdout.flush()
                 return sys.stdin.readline().rstrip("\n") or default
 
             try: