Skip to content

Commit

Permalink
Merge branch 'main' into antoine_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bitonio committed Feb 15, 2022
2 parents 6be5d9e + 3044099 commit 10d1f4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions bin/akamai-mfa
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import os
import json

#: cli-mfa version, see also cli.json
__VERSION__ = "0.0.5"
__VERSION__ = "0.0.7"
#: Log formatting aligned with other CLIs
LOG_FMT = '%(asctime)s [%(levelname)s] %(threadName)s %(message)s'
#: Near real-time, 30s ago is the most recent by default
Expand Down Expand Up @@ -86,8 +86,7 @@ class MFAConfig():
help="Discard the receipt attribute to save log space")

self.parser.add_argument("--edgerc", type=argparse.FileType('r'), default=os.path.expanduser("~/.edgerc"),
help='Location of the credentials file (default is %s)' %
os.path.expanduser("~/.edgerc"))
help='Location of the credentials file (default is "~/.edgerc")')

self.parser.add_argument("--section", default="default", help="Section inside .edgerc, default is [default]")
self.parser.add_argument("--debug", '-d', action="store_true", default=False, help="Debug mode")
Expand All @@ -104,11 +103,11 @@ class MFAConfig():

# 2. Load MFA params from .edgerc
edgerc_config = configparser.ConfigParser()
edgerc_config.read_file(self.edgerc)
edgerc_config.read(os.path.expanduser(self.edgerc))
if not edgerc_config.has_section(self.section):
err_msg = "ERROR: No section named %s was found in your .edgerc file\n" % self.section
err_msg += "ERROR: Please generate credentials for the script functionality\n"
err_msg += "ERROR: and run 'python gen_edgerc.py %s' to generate the credential file\n" % self.edgerc.name
err_msg += "ERROR: and run 'python gen_edgerc.py %s' to generate the credential file\n" % self.edgerc
sys.exit(err_msg)
for key, value in edgerc_config.items(self.section):
if key in MFAConfig.CONFIG_KEYS:
Expand Down
2 changes: 1 addition & 1 deletion cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"commands": [
{
"name": "mfa",
"version": "0.0.5",
"version": "0.0.7",
"description": "Akamai CLI for MFA"
}
]
Expand Down

0 comments on commit 10d1f4e

Please sign in to comment.