aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMilo Casagrande <milo@ubuntu.com>2013-01-21 15:14:43 +0100
committerMilo Casagrande <milo@ubuntu.com>2013-01-21 15:14:43 +0100
commitb6f40771b1fb513cd2210e718e873f8ded4ee18e (patch)
tree52fd8e74fade781a62a0f63a5d2eb25efd24ba62 /scripts
parent6b1f7678fe7cbf0198be4e6fccac4f1aa0c96f10 (diff)
Added required arguments, refactored var.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rhodecode-setup25
1 files changed, 14 insertions, 11 deletions
diff --git a/scripts/rhodecode-setup b/scripts/rhodecode-setup
index cb828ef..291006a 100644
--- a/scripts/rhodecode-setup
+++ b/scripts/rhodecode-setup
@@ -59,7 +59,8 @@ def cli_args():
"""Sets up the cli argument parser."""
parser = argparse.ArgumentParser(description=DESCRIPTION)
parser.add_argument("--rhodecode-config",
- help="Path to the config INI file.")
+ help="Path to the config INI file.",
+ required=True)
parser.add_argument("--rhodecode-data-dir",
default="/opt/rhodecode",
help="The directory where to store RhodeCode data "
@@ -68,7 +69,8 @@ def cli_args():
default=RHODECODE_ADMIN_USER,
help="The name of the admin user for RhodeCode.")
parser.add_argument("--rhodecode-admin-pwd",
- help="The password for RhodeCode admin user.")
+ help="The password for RhodeCode admin user.",
+ required=True)
parser.add_argument("--rhodecode-admin-email",
help="The email address for RhodeCode admin user.")
parser.add_argument("--rhodecode-usr",
@@ -96,11 +98,12 @@ def cli_args():
parser.add_argument("--no-celery",
action="store_true",
help="If Celery integration should be disabled.")
- parser.add_argument("--rabbitmq-user",
+ parser.add_argument("--rabbitmq-usr",
default=RABBITMQ_DEFAULT_USER,
help="The name to use for the RabbitMQ session.")
- parser.add_argument("--rabbitmq-passwd",
- help="The password for the RabbitMQ user.")
+ parser.add_argument("--rabbitmq-pwd",
+ help="The password for the RabbitMQ user.",
+ required=True)
parser.add_argument("--rabbitmq-vhost",
default=RABBITMQ_DEFAULT_VHOST,
help="The name of the RabbitMQ vhost for the user.")
@@ -129,12 +132,12 @@ def check_cli_args(args):
sys.exit(1)
if not args.no_celery:
- if (args.rabbitmq_user == RABBITMQ_DEFAULT_USER or \
+ if (args.rabbitmq_usr == RABBITMQ_DEFAULT_USER or \
args.rabbitmq_vhost == RABBITMQ_DEFAULT_VHOST):
print ("Warning: default values for --rabbitmq-user and/or "
"--rabbitmq-vhost are being used.")
- if not args.rabbitmq_passwd:
+ if not args.rabbitmq_pwd:
print ("To setup RhodeCode to correctly use Celery, it is "
"necessary to specify also the RabbitMQ user password.")
sys.exit(1)
@@ -443,8 +446,8 @@ def print_install_report(args, home_dir):
print "\nCelery/RabbitMQ Integration\n"
print "\tCelery activated: %s\n" % args.no_celery
if not args.no_celery:
- print "\tRabbitMQ User: %s\n" % args.rabbitmq_user
- print "\tRabbitMQ Password: %s\n" % args.rabbitmq_passwd
+ print "\tRabbitMQ User: %s\n" % args.rabbitmq_usr
+ print "\tRabbitMQ Password: %s\n" % args.rabbitmq_pwd
print "\tRabbitMQ Vhost: %s\n" % args.rabbitmq_vhost
if __name__ == '__main__':
@@ -481,8 +484,8 @@ if __name__ == '__main__':
create_postgresql_db(args.dbname)
if not args.no_celery:
- setup_rabbitmq_server(args.rabbitmq_user,
- args.rabbitmq_passwd,
+ setup_rabbitmq_server(args.rabbitmq_usr,
+ args.rabbitmq_pwd,
args.rabbitmq_vhost)
clone_rhodecode_code(args.rhodecode_git_url,