[Openstack] neutron code-python

Atif Saeed i_atif7 at hotmail.com
Wed Dec 23 19:06:56 UTC 2015




	
	
	
	


class
AddPortCommand(BaseCommand):

    def
__init__(self, api, bridge, port, may_exist):

       
super(AddPortCommand, self).__init__(api)

       
self.bridge = bridge

       
self.port = port

       
self.may_exist = may_exist



    def
run_idl(self, txn):

       
br = idlutils.row_by_value(self.api.idl, 'Bridge', 'name',
self.bridge)

        if
self.may_exist:

           
port = idlutils.row_by_value(self.api.idl, 'Port',
'name',

                                        
self.port, None)

           
if port:

               
return

        port =
txn.insert(self.api._tables['Port'])

       
port.name = self.port

       
br.verify('ports')

       
ports = getattr(br, 'ports', [])

       
ports.append(port)

       
br.ports = ports



       
iface = txn.insert(self.api._tables['Interface'])

       
iface.name = self.port

       
port.verify('interfaces')

       
ifaces = getattr(port, 'interfaces', [])

       
ifaces.append(iface)

       
port.interfaces = ifaces.


I want to do some changing in this code.
1. Make sure to only bridge TAP interfaces with private ethernet interfaces
 which are protected behind a firewall. Never bridge a TAP interface 
with the same ethernet interface you use to connect to the internet, as 
that would create a potential security hole.
how can I do this:- any help please.

Regards, 

A.


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20151223/0f7f245b/attachment.html>


More information about the Openstack mailing list