(cli, flavor)
Validate flavor.

    If flavor is None, skip the validation and use the default value
    from the heat template.
Validate flavor.
Validate flavor .
def validate_flavor(cli, flavor):
    """Validate flavor.

    If flavor is None, skip the validation and use the default value
    from the heat template.
    """

    if flavor is None:
        return
    flavor_list = cli.nova().flavors.list()
    for f in flavor_list:
        if f.name == flavor or f.id == flavor:
            return
    raise exception.FlavorNotFound(flavor=flavor)
def validate_flavor ( cli , flavor ) : if flavor is None : return flavor_list = cli . nova ( ) . flavors . list ( ) for f in flavor_list : if f . name == flavor or f . id == flavor : return raise exception . FlavorNotFound ( flavor = flavor )