Matteo Scandolo | 5e293c9 | 2017-08-08 13:05:23 -0700 | [diff] [blame] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
Sapan Bhatia | 8fc7eb3 | 2017-05-05 20:43:43 +0200 | [diff] [blame] | 17 | from django.db import models |
| 18 | from django.db.models import * |
Scott Baker | d7590f7 | 2017-07-18 11:37:22 -0700 | [diff] [blame] | 19 | from core.models import Service, XOSBase, Slice, Instance, ServiceInstance, ServiceInstanceLink, Node, Image, User, Flavor, NetworkParameter, NetworkParameterType, Port, AddressPool, User |
Sapan Bhatia | e86b4b6 | 2017-05-19 23:01:13 +0200 | [diff] [blame] | 20 | from core.models.xosbase import StrippedCharField |
Sapan Bhatia | 8fc7eb3 | 2017-05-05 20:43:43 +0200 | [diff] [blame] | 21 | import os |
| 22 | from django.db import models, transaction |
| 23 | from django.forms.models import model_to_dict |
| 24 | from django.db.models import Q |
| 25 | from operator import itemgetter, attrgetter, methodcaller |
| 26 | from core.models import Tag |
| 27 | from core.models.service import LeastLoadedNodeScheduler |
| 28 | from services.vrouter.models import VRouterService, VRouterTenant |
Scott Baker | c15556d | 2017-05-06 09:55:01 -0700 | [diff] [blame] | 29 | from services.rcord.models import CordSubscriberRoot |
Sapan Bhatia | 8fc7eb3 | 2017-05-05 20:43:43 +0200 | [diff] [blame] | 30 | import traceback |
| 31 | from xos.exceptions import * |
Matteo Scandolo | c102a24 | 2017-06-08 15:01:59 -0700 | [diff] [blame] | 32 | from xosconfig import Config |
Sapan Bhatia | 8fc7eb3 | 2017-05-05 20:43:43 +0200 | [diff] [blame] | 33 | |
| 34 | class ConfigurationError(Exception): |
| 35 | pass |
| 36 | |
| 37 | VOLT_KIND = "vOLT" |
Sapan Bhatia | 8fc7eb3 | 2017-05-05 20:43:43 +0200 | [diff] [blame] | 38 | |
| 39 | CORD_USE_VTN = getattr(Config(), "networking_use_vtn", False) |