def destroy(self, category, extras): """ Deletes the specified security group. """ context = extras['nova_ctx'] security_group = security.retrieve_group_by_name( category.term, extras['nova_ctx']) security.remove_group(security_group, context)
def destroy(self, category, extras): """ Deletes the specified security group. """ context = extras['nova_ctx'] security_group = security.retrieve_group_by_name(category.term, extras['nova_ctx']) security.remove_group(security_group, context)
def create(self, entity, extras): """ Creates a security rule. The group to add the rule to must exist. In OCCI-speak this means the mixin must be supplied with the request """ sec_mixin = get_sec_mixin(entity) context = extras['nova_ctx'] security_group = security.retrieve_group_by_name(sec_mixin.term, context) sg_rule = make_sec_rule(entity, security_group['id']) if security_group_rule_exists(security_group, sg_rule): # This rule already exists in group msg = 'This rule already exists in group. %s' %\ str(security_group) raise AttributeError(msg) security.create_rule(sec_mixin.term, security_group['id'], [sg_rule], context)
def create(self, entity, extras): """ Creates a security rule. The group to add the rule to must exist. In OCCI-speak this means the mixin must be supplied with the request """ sec_mixin = get_sec_mixin(entity) context = extras['nova_ctx'] security_group = security.retrieve_group_by_name( sec_mixin.term, context) sg_rule = make_sec_rule(entity, security_group['id']) if security_group_rule_exists(security_group, sg_rule): #This rule already exists in group msg = 'This rule already exists in group. %s' %\ str(security_group) raise AttributeError(msg) security.create_rule(sec_mixin.term, security_group['id'], [sg_rule], context)