def get_subnet(self, context, id, fields=None, verbose=None):
     """
     Returns a subnet dictionary containing corres subnet info
     """
     subnet = qdb._get_subnet(context, id)
     vlan = cdb.get_vlan_binding(subnet['network_id'])
     subnet['vlan_id'] = vlan
     return subnet
 def delete_subnet(self, context, id):
     """
     deletes a subnet from the switch
     """
     LOG.debug("CatalystPlugin:delete_network() called\n")
     sub = qdb._get_subnet(context, id)
     self._client.delete_subnet(id)
     return sub
 def update_subnet(self, context, id, subnet):
     """
     Updates the subnet given by id with details given in subnet
     """
     sub_existing = qdb._get_subnet(context, id)
     if subnet['ip_version']:
         sub_existing['ip_version'] = subnet['ip_version']
     if subnet['cidr']:
         sub_existing['cidr'] = subnet['cidr']
     if subnet['gateway_ip']:
         sub_existing['gateway_ip'] = subnet['gateway_ip']
     # Allocation pool update needs to be added
     return sub_existing