[openstack-dev] [keystone] Output on stderr

Abhishek Talwar/HYD/TCS abhishek.talwar at tcs.com
Wed Mar 4 11:50:57 UTC 2015

Hi All,

While working on a bug for keystoneclient I have replaced sys.exit with return. However, the code reviewers want that the output should be on stderr(as sys.exit does). So how can we get the output on stderr.

def do_user_password_update(kc, args):
    """Update user password."""
    user = utils.find_resource(kc.users, args.user)
    new_passwd = args.passwd or utils.prompt_for_password()
    if not new_passwd:
        msg = (_("\nPlease specify password using the --pass option "
                 "or using the prompt"))
        print(msg)      // I have included print and return here instead of sys.exit
    kc.users.update_password(user, new_passwd) 

Thanks and Regards
Abhishek Talwar
Employee ID : 770072
Assistant System Engineer
Tata Consultancy Services,Gurgaon
Contact Details : +918377882003
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150304/7d98418c/attachment.html>

More information about the OpenStack-dev mailing list