def update_a_cluster(base, cluster_id, profile_id=None, name=None,
    expected_status='SUCCEEDED', metadata=None, timeout=None, wait_timeout=None
    ):
    """Utility function that updates a Senlin cluster.

    Update a cluster and return it after it is ACTIVE.
    """
    params = {'cluster': {'profile_id': profile_id, 'metadata': metadata,
        'name': name, 'timeout': timeout}}
    res = base.client.update_obj('clusters', cluster_id, params)
    action_id = res['location'].split('/actions/')[1]
    base.client.wait_for_status('actions', action_id, expected_status,
        wait_timeout)
    return res['body']
