fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] Command status output OK in green color and FAILED in red


From: Carlos García
Subject: Re: [Fab-user] Command status output OK in green color and FAILED in red color
Date: Mon, 1 Jun 2015 15:22:11 +0200

Hi,

you can use colors, as explained here: http://docs.fabfile.org/en/1.10/api/core/colors.html. You need to use the value returned when executing run or sudo.

from fabric.colors import red, green
ret_code = sudo("ls -l")

if ret_code.succeeded :
 print(green("Success"))
else:
 print(red("Error"))

Also, you maby find useful these functions: http://docs.fabfile.org/en/1.10/api/core/utils.html

Regards

2015-06-01 13:45 GMT+02:00 Kaushal Shriyan <address@hidden>:
Hi,

Is there a native feature available in fabric tool similar to the example given in http://stackoverflow.com/questions/5506176/bash-echo-something-to-right-end-of-window-right-aligned?
 
For example if the command is successful then OK in green color and FAILED in red color
Any examples?

I would appreciate your help.

Regards,

Kaushal

_______________________________________________
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user





reply via email to

[Prev in Thread] Current Thread [Next in Thread]