~gpanders/gandi-cli

16fca99d637ff6b6f314b144172ea6b26ff8a041 — Greg Anders 2 months ago 143e789
Change mailbox id command line flag
1 files changed, 2 insertions(+), 2 deletions(-)

M src/gandi/commands/alias.py
M src/gandi/commands/alias.py => src/gandi/commands/alias.py +2 -2
@@ 5,7 5,7 @@ import requests

def create_command(parser):
    subparser = parser.add_parser("alias", help="manage email aliases")
    subparser.add_argument("-i", "--id", metavar="MAILBOX_ID", type=str)
    subparser.add_argument("-m", "--mailbox", metavar="MAILBOX_ID", type=str)
    subparser.add_argument("-d", "--domain", type=str)

    actions = subparser.add_mutually_exclusive_group(required=True)


@@ 18,7 18,7 @@ def create_command(parser):

def alias(config, auth, args):
    domain = args.domain if args.domain is not None else config["domain"]
    mailbox_id = args.id if args.id is not None else config["mailbox_id"]
    mailbox_id = args.mailbox if args.mailbox is not None else config["mailboxid"]
    url = f"https://api.gandi.net/v5/email/mailboxes/{domain}/{mailbox_id}"

    aliases = get_aliases(url, auth)