dalgibbard / citrix_xenserver_patcher

Auto / Manual Patching tool for Citrix XenServer Boxes
Do What The F*ck You Want To Public License
142 stars 45 forks source link

Add Script Flags to make code more usable. #3

Closed dalgibbard closed 10 years ago

dalgibbard commented 10 years ago

Examples requiring adding to code:

Therefore, someone running the following could patch a host hands-free:

./patcher.py -a -r

Or, Someone wanting to be notified of newly available, not yet applied patches could put this into Cron:

# Notify at 8am each day of pending patches.
0 8 * * * /path/to/patcher.py -l
dalgibbard commented 10 years ago

This also implicitly adds a requirement for "-h|--help" for displaying usage.

dalgibbard commented 10 years ago

The following flags are implemented in commit: fbb15f65ec4f179fe8d4d5a6b723e96649514630

-a  => Auto Install Patches
-e  => Exclude patches defined in a (pythonic) list
-r  => Allow for automatic reboot of node where required.
-l  => Just list available patches and take no further action.
-v  => Display script version
-h  => Display usage

Will consider adding "-q" for less verbosity later, but I don't see an enormous need for it at the moment. Will close this and leave it in the README as a reminder.