Matteo Scandolo | 6288d5a | 2017-08-08 13:05:26 -0700 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
Sapan Bhatia | 51a804c | 2017-05-03 17:24:37 +0200 | [diff] [blame] | 14 | from django.db import models |
Andrea Campanella | 2a2df42 | 2017-08-30 16:59:17 +0200 | [diff] [blame^] | 15 | from core.models import Service, XOSBase, Slice, Instance, TenantWithContainer, Node, Image, User, Flavor, NetworkParameter, NetworkParameterType, Port, AddressPool, User |
| 16 | from core.models.xosbase import StrippedCharField |
Sapan Bhatia | 51a804c | 2017-05-03 17:24:37 +0200 | [diff] [blame] | 17 | import os |
| 18 | from django.db import models, transaction |
Sapan Bhatia | 51a804c | 2017-05-03 17:24:37 +0200 | [diff] [blame] | 19 | from django.forms.models import model_to_dict |
Andrea Campanella | 2a2df42 | 2017-08-30 16:59:17 +0200 | [diff] [blame^] | 20 | from django.db.models import * |
Sapan Bhatia | 51a804c | 2017-05-03 17:24:37 +0200 | [diff] [blame] | 21 | from operator import itemgetter, attrgetter, methodcaller |
| 22 | from core.models import Tag |
| 23 | from core.models.service import LeastLoadedNodeScheduler |
Andrea Campanella | 2a2df42 | 2017-08-30 16:59:17 +0200 | [diff] [blame^] | 24 | from services.addressmanager.models import AddressManagerService, AddressManagerServiceInstance |
Sapan Bhatia | 51a804c | 2017-05-03 17:24:37 +0200 | [diff] [blame] | 25 | import traceback |
| 26 | from xos.exceptions import * |
Andrea Campanella | 2a2df42 | 2017-08-30 16:59:17 +0200 | [diff] [blame^] | 27 | from django.contrib.contenttypes.models import ContentType |
Sapan Bhatia | 51a804c | 2017-05-03 17:24:37 +0200 | [diff] [blame] | 28 | |
| 29 | class ConfigurationError(Exception): |
| 30 | pass |
| 31 | |
| 32 | VEG_KIND = "vEG" |
| 33 | CORD_SUBSCRIBER_KIND = "CordSubscriberRoot" |
Andrea Campanella | 2a2df42 | 2017-08-30 16:59:17 +0200 | [diff] [blame^] | 34 | |