~bbaqar/charms/trusty/neutron-api-plumgrid/temp

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/network/ovs/__init__.py

  • Committer: bbaqar at plumgrid
  • Date: 2016-04-25 09:05:55 UTC
  • mfrom: (18.1.7 neutron-api-plumgrid)
  • Revision ID: bbaqar@plumgrid.com-20160425090555-yl82ba6bhwjqkwr9
Merge: Liberty/Mitaka support

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
)
26
26
 
27
27
 
28
 
def add_bridge(name):
 
28
def add_bridge(name, datapath_type=None):
29
29
    ''' Add the named bridge to openvswitch '''
30
30
    log('Creating bridge {}'.format(name))
31
 
    subprocess.check_call(["ovs-vsctl", "--", "--may-exist", "add-br", name])
 
31
    cmd = ["ovs-vsctl", "--", "--may-exist", "add-br", name]
 
32
    if datapath_type is not None:
 
33
        cmd += ['--', 'set', 'bridge', name,
 
34
                'datapath_type={}'.format(datapath_type)]
 
35
    subprocess.check_call(cmd)
32
36
 
33
37
 
34
38
def del_bridge(name):