def sanitise_db_creds(creds):
    """Clean up certain values in the credentials to make sure that the DB driver
    doesn't get confused.
    """
    tmp = {}
    for name, value in creds.items():
        if name == 'port':
            tmp[name] = int(value)
        elif name == 'password':
            tmp['passwd'] = value
        else:
            tmp[name] = value
    return tmp