From f5da2af872a16bfcc9f3e06e64a73ad1b3daba92 Mon Sep 17 00:00:00 2001 From: vrde Date: Thu, 28 Apr 2016 15:46:33 +0200 Subject: [PATCH] Remove smelly code --- bigchaindb/commands/bigchain.py | 11 ++++++----- bigchaindb/commands/utils.py | 2 -- bigchaindb/config_utils.py | 3 --- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/bigchaindb/commands/bigchain.py b/bigchaindb/commands/bigchain.py index d23f99fc..b37a3812 100644 --- a/bigchaindb/commands/bigchain.py +++ b/bigchaindb/commands/bigchain.py @@ -59,8 +59,6 @@ def run_configure(args, skip_if_exists=False): skip_if_exists (bool): skip the function if a config file already exists """ config_path = args.config or bigchaindb.config_utils.CONFIG_DEFAULT_PATH - bigchaindb.config_utils.autoconfigure(filename=False, force=True) - config_file_exists = False # if the config path is `-` then it's stdout @@ -76,9 +74,13 @@ def run_configure(args, skip_if_exists=False): if want != 'y': return - # Patch the default configuration with the new values conf = copy.deepcopy(bigchaindb.config) - del conf['CONFIGURED'] + + # Patch the default configuration with the new values + conf = bigchaindb.config_utils.update( + conf, + bigchaindb.config_utils.env_config(bigchaindb.config)) + print('Generating keypair', file=sys.stderr) conf['keypair']['private'], conf['keypair']['public'] = \ @@ -173,7 +175,6 @@ def run_start(args): def _run_load(tx_left, stats): logstats.thread.start(stats) client = temp_client() - # b = bigchaindb.Bigchain() while True: tx = client.create() diff --git a/bigchaindb/commands/utils.py b/bigchaindb/commands/utils.py index b3cc356c..dc035de6 100644 --- a/bigchaindb/commands/utils.py +++ b/bigchaindb/commands/utils.py @@ -54,8 +54,6 @@ def start_rethinkdb(): # The last `line` contains info about the error. raise StartupError(line) - proc.kill() - def start(parser, scope): """Utility function to execute a subcommand. diff --git a/bigchaindb/config_utils.py b/bigchaindb/config_utils.py index 4256f580..dc396522 100644 --- a/bigchaindb/config_utils.py +++ b/bigchaindb/config_utils.py @@ -92,9 +92,6 @@ def file_config(filename=None): """ logger.debug('On entry into file_config(), filename = {}'.format(filename)) - if filename is False: - return {} - if filename is None: filename = CONFIG_DEFAULT_PATH