Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/116104
Change subject: Assert SSH_AUTH_SOCK exist after parse_args() ...................................................................... Assert SSH_AUTH_SOCK exist after parse_args() scap --help will bails out with an assertion error if one does not have the env variable SSH_AUTH_SOCK set. Moved the assert after parse_args() execution so it can show the help message. Mention in the help message that a ssh-agent is required. Change-Id: I519425f496f78dd28e7634736daa5a0e544559d5 --- M scap/main.py 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/scap refs/changes/04/116104/1 diff --git a/scap/main.py b/scap/main.py index 70e2695..58e0cc5 100644 --- a/scap/main.py +++ b/scap/main.py @@ -62,9 +62,8 @@ logger = logging.getLogger('scap') args = None try: - assert 'SSH_AUTH_SOCK' in os.environ, \ - 'scap requires SSH agent forwarding' - parser = argparse.ArgumentParser(description='Deploy MediaWiki') + parser = argparse.ArgumentParser(description='Deploy MediaWiki', + epilog="Note: a ssh-agent is required to run this script.") parser.add_argument('--versions', type=lambda v: set(v.split()), help='Sync only specifed versions') @@ -74,6 +73,10 @@ parser.add_argument('message', nargs=argparse.REMAINDER, help='Log message for SAL') args = parser.parse_args() + + assert 'SSH_AUTH_SOCK' in os.environ, \ + 'scap requires SSH agent forwarding' + args.message = ' '.join(args.message) or '(no message)' args.cfg = None -- To view, visit https://gerrit.wikimedia.org/r/116104 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I519425f496f78dd28e7634736daa5a0e544559d5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/tools/scap Gerrit-Branch: master Gerrit-Owner: Hashar <has...@free.fr> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits