CORD-1083 move CordSubscriberRoot to rcord repo
Change-Id: I153668a67abcf0ab461b59ed3ed6a63afcf5f7c4
diff --git a/xos/attic/cordsubscriberroot_bottom.py b/xos/attic/cordsubscriberroot_bottom.py
deleted file mode 100644
index 5821215..0000000
--- a/xos/attic/cordsubscriberroot_bottom.py
+++ /dev/null
@@ -1 +0,0 @@
-CordSubscriberRoot.setup_simple_attributes()
diff --git a/xos/attic/cordsubscriberroot_model.py b/xos/attic/cordsubscriberroot_model.py
deleted file mode 100644
index 6183113..0000000
--- a/xos/attic/cordsubscriberroot_model.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# 'simple_attributes' will be expanded into properties and setters that
-# store the attribute using self.set_attribute / self.get_attribute.
-
-simple_attributes = ( ("devices", []), )
-
-sync_attributes = ("firewall_enable",
- "firewall_rules",
- "url_filter_enable",
- "url_filter_rules",
- "cdn_enable",
- "uplink_speed",
- "downlink_speed",
- "enable_uverse",
- "status")
-
-def __init__(self, *args, **kwargs):
- super(CordSubscriberRoot, self).__init__(*args, **kwargs)
- self.cached_volt = None
-
-@property
-def volt(self):
- volt = self.get_newest_subscribed_tenant(VOLTTenant)
- if not volt:
- return None
-
- # always return the same object when possible
- if (self.cached_volt) and (self.cached_volt.id == volt.id):
- return self.cached_volt
-
- #volt.caller = self.creator
- self.cached_volt = volt
- return volt
-
-def find_device(self, mac):
- for device in self.devices:
- if device["mac"] == mac:
- return device
- return None
-
-def update_device(self, mac, **kwargs):
- # kwargs may be "level" or "mac"
- # Setting one of these to None will cause None to be stored in the db
- devices = self.devices
- for device in devices:
- if device["mac"] == mac:
- for arg in kwargs.keys():
- device[arg] = kwargs[arg]
- self.devices = devices
- return device
- raise ValueError("Device with mac %s not found" % mac)
-
-def create_device(self, **kwargs):
- if "mac" not in kwargs:
- raise XOSMissingField("The mac field is required")
-
- if self.find_device(kwargs['mac']):
- raise XOSDuplicateKey("Device with mac %s already exists" % kwargs["mac"])
-
- device = kwargs.copy()
-
- devices = self.devices
- devices.append(device)
- self.devices = devices
-
- return device
-
-def delete_device(self, mac):
- devices = self.devices
- for device in devices:
- if device["mac"]==mac:
- devices.remove(device)
- self.devices = devices
- return
-
- raise ValueError("Device with mac %s not found" % mac)
-
-#--------------------------------------------------------------------------
-# Deprecated -- devices used to be called users
-
-def find_user(self, uid):
- return self.find_device(uid)
-
-def update_user(self, uid, **kwargs):
- return self.update_device(uid, **kwargs)
-
-def create_user(self, **kwargs):
- return self.create_device(**kwargs)
-
-def delete_user(self, uid):
- return self.delete_user(uid)
-
-# ------------------------------------------------------------------------
-
-@property
-def services(self):
- return {"cdn": self.cdn_enable,
- "url_filter": self.url_filter_enable,
- "firewall": self.firewall_enable}
-
-@services.setter
-def services(self, value):
- pass
-
-def save(self, *args, **kwargs):
- self.validate_unique_service_specific_id(none_okay=True)
- if (not hasattr(self, 'caller') or not self.caller.is_admin):
- if (self.has_field_changed("service_specific_id")):
- raise XOSPermissionDenied("You do not have permission to change service_specific_id")
- super(CordSubscriberRoot, self).save(*args, **kwargs)
-
- # TODO - reimplement this as a watcher
-
- if (self.volt) and (self.volt.vcpe):
- # 1) trigger manage_bbs_account to run
- # 2) trigger vcpe observer to wake up
- self.volt.vcpe.save()
diff --git a/xos/attic/header.py b/xos/attic/header.py
index 8561d92..56ffd5e 100644
--- a/xos/attic/header.py
+++ b/xos/attic/header.py
@@ -10,6 +10,7 @@
from core.models import Tag
from core.models.service import LeastLoadedNodeScheduler
from services.vrouter.models import VRouterService, VRouterTenant
+from services.rcord.models import CordSubscriberRoot
import traceback
from xos.exceptions import *
from xos.config import Config
@@ -18,6 +19,5 @@
pass
VOLT_KIND = "vOLT"
-CORD_SUBSCRIBER_KIND = "CordSubscriberRoot"
CORD_USE_VTN = getattr(Config(), "networking_use_vtn", False)