1
0
mirror of https://github.com/bigchaindb/bigchaindb.git synced 2024-06-28 00:27:45 +02:00

Changed --bind-http-to-localhost to be a boolean flag argument

This commit is contained in:
troymc 2016-11-28 16:37:19 +01:00
parent 785ee4b726
commit bf2b322739

View File

@ -13,13 +13,13 @@ from hostlist import public_dns_names
# Parse the command-line arguments
parser = argparse.ArgumentParser()
parser.add_argument("--bind-http-to-localhost",
help="should RethinkDB web interface be bound to localhost?",
required=True)
# The next line isn't strictly necessary, but it clarifies the default case:
parser.set_defaults(bind_http_to_localhost=False)
parser.add_argument('--bind-http-to-localhost',
action='store_true',
help='should RethinkDB web interface be bound to localhost?')
args = parser.parse_args()
# args.bind_http_to_localhost is a string at this point.
# It's either 'True' or 'False' but we want a boolean:
bind_http_to_localhost = (args.bind_http_to_localhost == 'True')
bind_http_to_localhost = args.bind_http_to_localhost
# cwd = current working directory
old_cwd = os.getcwd()