def convert_string_to_tuple(creds_string):
    """Recreate a MAAS API credentials tuple from a colon-separated string."""
    creds_tuple = tuple(creds_string.split(':'))
    if len(creds_tuple) != 3:
        raise ValueError(
            "Malformed credentials string.  Expected 3 colon-separated items, "
            "got %r."
            % creds_string)
    return creds_tuple