Use configargparse instead of argparse, it also honours env
This commit is contained in:
parent
c29ad2aec0
commit
953a98f9e2
|
@ -18,7 +18,7 @@ from __future__ import division
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import argparse
|
import configargparse
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from flatten_json import flatten
|
from flatten_json import flatten
|
||||||
|
@ -679,7 +679,7 @@ if __name__ == '__main__':
|
||||||
hbase_master_default_address = 'localhost:' + str(hbase_master_ui_default_port)
|
hbase_master_default_address = 'localhost:' + str(hbase_master_ui_default_port)
|
||||||
hdfs_namenode_default_address = 'localhost:' + str(hdfs_namenode_default_port)
|
hdfs_namenode_default_address = 'localhost:' + str(hdfs_namenode_default_port)
|
||||||
|
|
||||||
parser = argparse.ArgumentParser( description="")
|
parser = configargparse.ArgParser( description="")
|
||||||
parser.add_argument('--hbase-master', dest='hbase_master', action='append', help="HBase master address, can be specified multiple times", type=str, default=hbase_master_default_address)
|
parser.add_argument('--hbase-master', dest='hbase_master', action='append', help="HBase master address, can be specified multiple times", type=str, default=hbase_master_default_address)
|
||||||
parser.add_argument('--hdfs-namenode', dest='hdfs_namenode', action='append', help="HDFS namenode address, can be specified multiple times", type=str, default=hdfs_namenode_default_address)
|
parser.add_argument('--hdfs-namenode', dest='hdfs_namenode', action='append', help="HDFS namenode address, can be specified multiple times", type=str, default=hdfs_namenode_default_address)
|
||||||
parser.add_argument('--zookeeper-server-address', dest='zk_server', action='append', help="ZooKeeper server address, can be specified multiple times", type=str, required=True)
|
parser.add_argument('--zookeeper-server-address', dest='zk_server', action='append', help="ZooKeeper server address, can be specified multiple times", type=str, required=True)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
beautifulsoup4 >= 4.7.1
|
beautifulsoup4 >= 4.7.1
|
||||||
|
configargparse >= 1.2.3
|
||||||
flatten_json >= 0.1.6
|
flatten_json >= 0.1.6
|
||||||
kazoo >= 2.6.0
|
kazoo >= 2.6.0
|
||||||
requests >= 2.21.0
|
requests >= 2.21.0
|
||||||
|
|
Loading…
Reference in New Issue