From 85390c3267634cc0860def38959c7f0d019a2680 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 20 Sep 2019 16:17:12 -0400 Subject: [PATCH] RF: avoid code duplication, use os.path.join over all components of the path --- NDATools/clientscripts/vtcmd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NDATools/clientscripts/vtcmd.py b/NDATools/clientscripts/vtcmd.py index 3232683..781ff4e 100644 --- a/NDATools/clientscripts/vtcmd.py +++ b/NDATools/clientscripts/vtcmd.py @@ -100,8 +100,9 @@ def configure(args): # create a new config file in user's home directory if one does not exist NDATools.Utils.logging.getLogger().setLevel(logging.DEBUG) - if os.path.isfile(os.path.join(os.path.expanduser('~'), '.NDATools/settings.cfg')): - config = ClientConfiguration(os.path.join(os.path.expanduser('~'), '.NDATools/settings.cfg'), args.username, + config_file = os.path.join(os.path.expanduser('~'), '.NDATools', 'settings.cfg') + if os.path.isfile(config_file): + config = ClientConfiguration(config_file, args.username, args.password, args.accessKey, args.secretKey) else: config = ClientConfiguration('clientscripts/config/settings.cfg', args.username, args.password, args.accessKey,