def update_security_group(context, id, security_group): if id == DEFAULT_SG_UUID: raise sg_ext.SecurityGroupCannotUpdateDefault() new_group = security_group["security_group"] with context.session.begin(): group = db_api.security_group_find(context, id=id, scope=db_api.ONE) db_group = db_api.security_group_update(context, group, **new_group) return v._make_security_group_dict(db_group)
def update_security_group(context, id, security_group): if id == DEFAULT_SG_UUID: raise sg_ext.SecurityGroupCannotUpdateDefault() new_group = security_group["security_group"] with context.session.begin(): group = db_api.security_group_find(context, id=id, scope=db_api.ONE) db_group = db_api.security_group_update(context, group, **new_group) return v._make_security_group_dict(db_group)