update slice model
diff --git a/plstackapi/core/models.py b/plstackapi/core/models.py
index e70da9b..a9243e9 100644
--- a/plstackapi/core/models.py
+++ b/plstackapi/core/models.py
@@ -106,7 +106,7 @@
enabled = models.BooleanField(default=True, help_text="Status for this Slice")
SLICE_CHOICES = (('plc', 'PLC'), ('delegated', 'Delegated'), ('controller','Controller'), ('none','None'))
instantiation = models.CharField(help_text="The instantiation type of the slice", max_length=80, choices=SLICE_CHOICES)
- omf_friendly = models.BooleanField()
+ omf_friendly = models.BooleanField(default=False)
description=models.TextField(blank=True,help_text="High level description of the slice and expected activities", max_length=1024)
slice_url = models.URLField(blank=True, max_length=512)
site = models.ForeignKey(Site, related_name='slices', help_text="The Site this Node belongs too")
@@ -115,34 +115,6 @@
def __unicode__(self): return u'%s' % (self.name)
- def save(self, *args, **kwds):
- # sync keystone tenant
- driver = OpenStackDriver()
-
- if not self.id:
- tenant = driver.create_tenant(tenant_name=self.name,
- description=self.description,
- enabled=self.enabled)
- self.tenant_id = tenant.id
-
- # create a network
- network = driver.create_network(name=self.name)
- self.network_id = network['id']
- # create router
- router = driver.create_router(name=self.name)
- self.router_id = router['id']
-
- else:
- # update record
- self.driver.update_tenant(self.tenant_id, name=self.name,
- description=self.description, enabled=self.enabled)
- super(Slice, self).save(*args, **kwds)
-
- def delete(self, *args, **kwds):
- # delete keystone tenant
- driver = OpenStackDriver()
- driver.delete_tenant(self.tenant_id)
- super(Slice, self).delete(*args, **kwds)
class SliceMembership(PlCoreBase):
user = models.ForeignKey('User', related_name='slice_memberships')