Loading src/webui/service/slice/routes.py +5 −3 Original line number Diff line number Diff line Loading @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. import json from typing import Dict, Optional import grpc from flask import current_app, redirect, render_template, Blueprint, flash, session, url_for from common.proto.context_pb2 import IsolationLevelEnum, Slice, SliceId, SliceStatusEnum, EndPointId from common.proto.context_pb2 import IsolationLevelEnum, Slice, SliceId, SliceStatusEnum, EndPointId, SliceConfig, ConfigRule from common.tools.context_queries.Context import get_context from common.tools.context_queries.EndPoint import get_endpoint_names from common.tools.context_queries.Slice import get_slice_by_uuid Loading @@ -36,12 +38,12 @@ class ConfigRuleNotFoundError(Exception): ... def get_custom_config_rule( service_config: ServiceConfig, resource_key: str slice_config: SliceConfig, resource_key: str ) -> Optional[ConfigRule]: """ Retrieve the custom config rule with the given resource_key from a ServiceConfig. """ for cr in service_config.config_rules: for cr in slice_config.config_rules: if ( cr.WhichOneof("config_rule") == "custom" and cr.custom.resource_key == resource_key Loading Loading
src/webui/service/slice/routes.py +5 −3 Original line number Diff line number Diff line Loading @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. import json from typing import Dict, Optional import grpc from flask import current_app, redirect, render_template, Blueprint, flash, session, url_for from common.proto.context_pb2 import IsolationLevelEnum, Slice, SliceId, SliceStatusEnum, EndPointId from common.proto.context_pb2 import IsolationLevelEnum, Slice, SliceId, SliceStatusEnum, EndPointId, SliceConfig, ConfigRule from common.tools.context_queries.Context import get_context from common.tools.context_queries.EndPoint import get_endpoint_names from common.tools.context_queries.Slice import get_slice_by_uuid Loading @@ -36,12 +38,12 @@ class ConfigRuleNotFoundError(Exception): ... def get_custom_config_rule( service_config: ServiceConfig, resource_key: str slice_config: SliceConfig, resource_key: str ) -> Optional[ConfigRule]: """ Retrieve the custom config rule with the given resource_key from a ServiceConfig. """ for cr in service_config.config_rules: for cr in slice_config.config_rules: if ( cr.WhichOneof("config_rule") == "custom" and cr.custom.resource_key == resource_key Loading