Exemplo n.º 1
0
def _find_rule(rule, rule_type):
    security_group = _get_security_group(rule)

    if rule_type in security_group:
        found_rules = security_group[rule_type]

        for found_rule in found_rules:
            if _compare_rules(rule, found_rule):
                return found_rule["ruleid"]

    errors.invalid_permission()
Exemplo n.º 2
0
def _find_rule(rule, rule_type):
    security_group = _get_security_group(rule)

    if rule_type in security_group:
        found_rules = security_group[rule_type]

        for found_rule in found_rules:
            if _compare_rules(rule, found_rule):
                return found_rule['ruleid']

    errors.invalid_permission()
Exemplo n.º 3
0
def _find_rule(rule, rule_type):
    """
    Searches a Cloudstack response for a rule and returns its Id.

    @param rule: Rule to be found.
    @param rule_type: Type of rule.
    @return: Id of the rule.
    """
    security_group = _get_security_group(rule)

    if rule_type in security_group:
        found_rules = security_group[rule_type]

        for found_rule in found_rules:
            if _compare_rules(rule, found_rule):
                return found_rule['ruleid']

    errors.invalid_permission()
Exemplo n.º 4
0
def _find_rule(rule, rule_type):
    """
    Searches a Cloudstack response for a rule and returns its Id.

    @param rule: Rule to be found.
    @param rule_type: Type of rule.
    @return: Id of the rule.
    """
    security_group = _get_security_group(rule)

    if rule_type in security_group:
        found_rules = security_group[rule_type]

        for found_rule in found_rules:
            if _compare_rules(rule, found_rule):
                return found_rule['ruleid']

    errors.invalid_permission()