Skip to content

Commit

Permalink
Merge pull request #1 from akamai/development
Browse files Browse the repository at this point in the history
fixed a bug in edgerc handling
  • Loading branch information
bitonio authored Jun 10, 2021
2 parents 86826b0 + ff2e1e0 commit 8f73614
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/akamai-mfa
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class MFAConfig():
eventparser.add_argument("--noreceipt", default=False, action="store_true",
help="Discard the receipt attribute to save log space")

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

self.parser.add_argument("--section", default="default", help="Section inside .edgerc, default is [default]")
Expand All @@ -104,7 +104,7 @@ class MFAConfig():

# 2. Load MFA params from .edgerc
edgerc_config = configparser.ConfigParser()
edgerc_config.read_file(self.edgerc)
edgerc_config.read_file(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"
Expand Down

0 comments on commit 8f73614

Please sign in to comment.