(context, cluster_template, cluster=None)
Validate ClusterTemplate's OpenStack Resources
Validate ClusterTemplate's OpenStack Resources
Validate ClusterTemplate s OpenStack Resources
def validate_os_resources(context, cluster_template, cluster=None):
    """Validate ClusterTemplate's OpenStack Resources"""

    cli = clients.OpenStackClients(context)

    for attr, validate_method in validators.items():
        if cluster and attr in cluster and cluster[attr]:
            if attr != 'labels':
                validate_method(cli, cluster[attr])
            else:
                validate_method(cluster[attr])
        elif attr in cluster_template and cluster_template[attr] is not None:
            if attr != 'labels':
                validate_method(cli, cluster_template[attr])
            else:
                validate_method(cluster_template[attr])

    if cluster:
        validate_keypair(cli, cluster['keypair'])
def validate_os_resources ( context , cluster_template , cluster = None ) : cli = clients . OpenStackClients ( context ) for attr , validate_method in validators . items ( ) : if cluster and attr in cluster and cluster [ attr ] : if attr != 'labels' : validate_method ( cli , cluster [ attr ] ) else : validate_method ( cluster [ attr ] ) elif attr in cluster_template and cluster_template [ attr ] is not None : if attr != 'labels' : validate_method ( cli , cluster_template [ attr ] ) else : validate_method ( cluster_template [ attr ] ) if cluster : validate_keypair ( cli , cluster [ 'keypair' ] )