update Subnet admin
diff --git a/plstackapi/core/api/subnets.py b/plstackapi/core/api/subnets.py
index ad1a877..a2417bc 100644
--- a/plstackapi/core/api/subnets.py
+++ b/plstackapi/core/api/subnets.py
@@ -1,3 +1,4 @@
+import commands
 from types import StringTypes
 from plstackapi.openstack.client import OpenStackClient
 from plstackapi.openstack.driver import OpenStackDriver
@@ -5,6 +6,7 @@
 from plstackapi.core.models import Subnet
 from plstackapi.core.api.slices import _get_slices
 
+
 def _get_subnets(filter):
     if isinstance(filter, StringTypes) and filter.isdigit():
         filter = int(filter)
diff --git a/plstackapi/core/models/subnet.py b/plstackapi/core/models/subnet.py
index fc16eec..ae25b63 100644
--- a/plstackapi/core/models/subnet.py
+++ b/plstackapi/core/models/subnet.py
@@ -1,4 +1,5 @@
 import os
+import commands    
 from django.db import models
 from plstackapi.core.models import PlCoreBase
 from plstackapi.core.models import Slice
@@ -7,7 +8,7 @@
 # Create your models here.
 
 class Subnet(PlCoreBase):
-    subnet_id = models.CharField(max_length=256, unique=True)
+    subnet_id = models.CharField(max_length=256, unique=True, blank=True)
     cidr = models.CharField(max_length=20)
     ip_version = models.IntegerField()
     start = models.IPAddressField()
@@ -16,3 +17,29 @@
 
     def __unicode__(self):  return u'%s' % (self.slice.name)
 
+    def save(self, *args, **kwds):
+
+        driver = OpenStackDriver()
+        if not self.subnet_id:
+            quantum_subnet = driver.create_subnet(name= self.slice.name,
+                                          network_id=self.slice.network_id,
+                                          cidr_ip = self.cidr,
+                                          ip_version=self.ip_version,
+                                          start = self.start,
+                                          end = self.end)
+            self.subnet_id = quantum_subnet['id']
+            # add subnet as interface to slice's router
+            driver.add_router_interface(self.slice.router_id, self.subnet_id)
+            add_route = 'route add -net %s dev br-ex gw 10.100.0.5' % self.cidr
+            commands.getstatusoutput(add_route)
+
+        super(Subnet, self).save(*args, **kwds)
+
+    def delete(self, *args, **kwds):
+        driver = OpenStackDriver()
+        if self.subnet_id:
+            #driver.delete_router_interface(self.slice.router_id, self.subnet_id) 
+            driver.delete_subnet(self.subnet_id)
+        del_route = 'route del -net %s' % self.cidr 
+        commands.getstatusoutput(del_route)
+        super(Subnet, self).delete(*args, **kwds)
diff --git a/plstackapi/openstack/driver.py b/plstackapi/openstack/driver.py
index a804db7..876d089 100644
--- a/plstackapi/openstack/driver.py
+++ b/plstackapi/openstack/driver.py
@@ -164,7 +164,7 @@
         subnets = self.shell.quantum.list_subnets()['subnets']
         for subnet in subnets:
             if subnet['id'] == id:
-                self.shell.quantum.delete_subnet(id=id)
+                self.shell.quantum.delete_subnet(id)
         return