

def _get_cluster_field(cluster, field):
    if cluster.get(field):
        return cluster[field]
    if cluster.get('cluster_template_id'):
        cluster_template = api.get_cluster_template(id=cluster['cluster_template_id'])
        if cluster_template.get(field):
            return cluster_template[field]
    return None

dataset/ETHPy150Open openstack/sahara/sahara/service/validations/clusters.py _get_cluster_field/original