Refactor to /opt/planetstack, final tweaks to make sure planetstack can run in non-openstack mode, adjustments to GUI for model focus changes
diff --git a/planetstack/core/models/subnet.py b/planetstack/core/models/subnet.py
new file mode 100644
index 0000000..cad9fea
--- /dev/null
+++ b/planetstack/core/models/subnet.py
@@ -0,0 +1,25 @@
+import os
+import commands
+from django.db import models
+from core.models import PlCoreBase
+from core.models import Slice
+
+# Create your models here.
+
+class Subnet(PlCoreBase):
+ subnet_id = models.CharField(max_length=256, unique=True)
+ cidr = models.CharField(max_length=20)
+ ip_version = models.IntegerField()
+ start = models.IPAddressField()
+ end = models.IPAddressField()
+ slice = models.ForeignKey(Slice, related_name='subnet')
+
+ def __unicode__(self): return u'%s' % (self.slice.name)
+
+ def save(self, *args, **kwds):
+ self.os_manager.save_subnet(self)
+ super(Subnet, self).save(*args, **kwds)
+
+ def delete(self, *args, **kwds):
+ self.os_manager.delete_subnet(self)
+ super(Subnet, self).delete(*args, **kwds)