Batch mode displays prompt

Bug #1381680 reported by Dean Troyer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cliff
Fix Released
Undecided
Cedric Brandily
python-openstackclient
Invalid
Low
Unassigned

Bug Description

Batch mode is interactive mode with input from a file or stdin w/o a tty (redirected). The prompt string is printed disrupting output. Prompt should be suppressed when stdin is not a tty.

openstack <<EOF
container create qaz wsx
EOF

(openstack) +---------------------------------------+-----------+------------------------------------+
| account | container | x-trans-id |
+---------------------------------------+-----------+------------------------------------+
| AUTH_d9eb486b4a7f44358954873f1b1be145 | qaz | tx6241e1e98e224755a2bda-00543ebc54 |
| AUTH_d9eb486b4a7f44358954873f1b1be145 | wsx | txc5e19b663e674f69abeda-00543ebc54 |
+---------------------------------------+-----------+------------------------------------+

Dean Troyer (dtroyer)
Changed in python-openstackclient:
importance: Undecided → Low
status: New → Triaged
description: updated
Revision history for this message
Cedric Brandily (cbrandily) wrote :

It seems to be a cmd2 limitation of Cmd.pseudo_raw_input

Changed in python-cliff:
assignee: nobody → Cedric Brandily (cbrandily)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cliff (master)

Fix proposed to branch: master
Review: https://review.openstack.org/157999

Changed in python-cliff:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cliff (master)

Reviewed: https://review.openstack.org/157999
Committed: https://git.openstack.org/cgit/openstack/cliff/commit/?id=08ed6b4c99ef7d7e972b82682ad3db43ee3fbaea
Submitter: Jenkins
Branch: master

commit 08ed6b4c99ef7d7e972b82682ad3db43ee3fbaea
Author: Cedric Brandily <email address hidden>
Date: Sat Feb 21 00:11:14 2015 +0100

    Hide prompt in batch/pipe mode

    Currently cliff prints prompt in batch/pipe mode:

    I-AM-A-PROMPT$ echo file | cliffdemo
    (cliffdemo) +---------------+--------------+
    | Field | Value |
    +---------------+--------------+
    | Name | . |
    | Size | 4096 |
    | UID | 1124 |
    | GID | 1000 |
    | Modified Time | 1424473806.9 |
    +---------------+--------------+
    (cliffdemo) I-AM-A-PROMPT$

    This change removes the prompt when batch/pipe mode is detected:

    I-AM-A-PROMPT$ echo file | cliffdemo
    +---------------+--------------+
    | Field | Value |
    +---------------+--------------+
    | Name | . |
    | Size | 4096 |
    | UID | 1124 |
    | GID | 1000 |
    | Modified Time | 1424473806.9 |
    +---------------+--------------+
    I-AM-A-PROMPT$

    Change-Id: Id17b3a3a4e63f24a0f5db92fb9fe71180ce752e2
    Closes-Bug: #1381680

Changed in python-cliff:
status: In Progress → Fix Committed
Revision history for this message
Steve Martinelli (stevemar) wrote :

this will be fixed in OSC when we get a new version of cliff

Changed in python-openstackclient:
status: Triaged → Invalid
Changed in python-cliff:
milestone: none → 1.10.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.