DoAll.py

#!/usr/bin/env python
#
import argparse

PACKET_NAME = 'hasyutils'

def main():
    parser = argparse.ArgumentParser( 
        formatter_class = argparse.RawDescriptionHelpFormatter,
        description="  updates python-%s, python3-%s on all hosts from the repo" % (PACKET_NAME, PACKET_NAME))
    
    parser.add_argument('-x', dest="execute", action="store_true", default = False, 
                        help='update python-%s, python3-%s on all nodes, from repo' % (PACKET_NAME, PACKET_NAME))
 
    parser.add_argument('-r', dest="updateRepo", action="store_true", default = False, help='update repo first')
     
    args = parser.parse_args()

    if not args.execute:
        parser.print_help()
        return 
    
    if args.updateRepo:
        print( "Updating repo")