CORD-2753 set default owner for ProgranServiceInstance
Change-Id: I0707d4edfba3ba7b6c8e44523afc1de133c12ea9
diff --git a/xos/models/models.py b/xos/models/models.py
index fef3fb1..3544d25 100644
--- a/xos/models/models.py
+++ b/xos/models/models.py
@@ -78,14 +78,6 @@
# TODO we should not allow name changes as name is the mapping with the backend
- # NOTE someone is setting owner_id, so just override it for now
- try:
- # NOTE we allow just one ProgranService
- progran_service = ProgranService.objects.all()[0]
- self.owner_id = progran_service.id
- except IndexError:
- raise XOSValidationError("Service Progran cannot be found, please make sure that the model exists.")
-
# name is mandatory
if not self.name:
raise XOSValidationError("name is mandatory for ProgranServiceInstances")
diff --git a/xos/models/progran.xproto b/xos/models/progran.xproto
index a6935de..47e21db 100644
--- a/xos/models/progran.xproto
+++ b/xos/models/progran.xproto
@@ -37,6 +37,7 @@
message ProgranServiceInstance (ServiceInstance){
option verbose_name = "Progran Service Instance";
option description = "Represent a Profile in the Progran ONOS Application";
+ option owner_class_name="ProgranService";
required string DlSchedType = 1 [default = "RR", choices = "(('RR', 'Round Robin'), ('PF', 'Proportional Fairness'), ('MAXCI', 'Maximum C/I'))", max_length = 30, blank = False, null = False, db_index = False];
required int32 DlAllocRBRate = 2 [default = "0", db_index = False, null = False, blank = False];