def return_period_from_string(arg):
    """
    Takes a string such as "days=1,seconds=30" and strips the quotes
    and returns a dictionary with the key/value pairs

    """
    period = {}

    if arg[0] == '"' and arg[-1] == '"':
        opt = arg[1:-1]  # remove quotes
    else:
        opt = arg

    for o in opt.split(","):
        key, value = o.split("=")
        period[str(key)] = int(value)

    return period