def htpasswd_fn(): try: return _sh_htpasswd() except sh.CommandNotFound: logging.error("'htpasswd' not found in the path. Install 'htpasswd' and try again") sys.exit(1)