Username on OpenStack interactive CLI

asked 2017-09-04 09:22:14 -0500

GTIM gravatar image

updated 2017-09-04 09:24:23 -0500

Is it possible to have the username printed when entering the OpenStack interactive CLI? Something similar to what happens to bash CLI when sourcing a rc file containing:

export PS1='[\u@\h \W(keystone_cloud-test3)]\$ '

So from the actual status:

[stack@director-totp ~]$ source tmp-rc-file
[stack@director-totp ~(keystone_openstack-user-001)]$ openstack
(openstack) user list

I would like to achieve this result:

[stack@director-totp ~]$ source tmp-rc-file
[stack@director-totp ~(keystone_openstack-user-001)]$ openstack
(openstack keystone_openstack-user-001) user list

In order to check at first glance which user is performing the specific command this feature would be very useful (especially if running many commands in interactive mode).


edit retag flag offensive close merge delete


This works almost. The prompt is not printed at the right time. Perhaps you have time and energy to try fixing it.

echo 'set prompt "bla> "'
while read x
do echo $x
} | openstack

There doesn't seem to be an option to set the prompt before starting the client.

Bernd Bausch gravatar imageBernd Bausch ( 2017-09-05 00:36:35 -0500 )edit