Add option for data port

This commit is contained in:
James Page 2014-11-10 16:15:04 +00:00
parent dbe062fa63
commit a317e43169
4 changed files with 19 additions and 2 deletions

View File

@ -53,4 +53,11 @@ options:
type: string type: string
default: default:
description: Comma separated list of key=value config flags to be set in nova.conf. description: Comma separated list of key=value config flags to be set in nova.conf.
data-port:
type: string
default:
description: |
The data port will be added to br-data and will allow usage of flat or VLAN
network types with Neutron.

7
hooks/fabfile.py vendored
View File

@ -37,6 +37,13 @@ def add_bridge(bridge_name):
sudo('ovs-vsctl -- --may-exist add-br %s' % bridge_name) sudo('ovs-vsctl -- --may-exist add-br %s' % bridge_name)
def add_bridge_port(bridge_name, port):
sudo('ovs-vsctl -- --may-exist add-port %s %s' % (bridge_name,
port))
sudo('ip link set %s up' % port)
sudo('ip link set %s promisc on' % port)
def enable_shell(user): def enable_shell(user):
sudo('usermod -s /bin/bash {}'.format(user)) sudo('usermod -s /bin/bash {}'.format(user))

View File

@ -1,12 +1,10 @@
from charmhelpers.contrib.openstack import context from charmhelpers.contrib.openstack import context
from charmhelpers.contrib.openstack.utils import get_host_ip
from charmhelpers.core.hookenv import ( from charmhelpers.core.hookenv import (
config, config,
log, log,
relation_get, relation_get,
relation_ids, relation_ids,
related_units, related_units,
unit_get,
ERROR, ERROR,
) )

View File

@ -5,6 +5,7 @@ from collections import OrderedDict
from charmhelpers.core.hookenv import ( from charmhelpers.core.hookenv import (
charm_dir, charm_dir,
log, log,
config,
) )
from charmhelpers.core.host import ( from charmhelpers.core.host import (
file_hash file_hash
@ -113,6 +114,10 @@ class POWERProxy():
def add_bridges(self): def add_bridges(self):
execute(add_bridge, 'br-int') execute(add_bridge, 'br-int')
execute(add_bridge, 'br-data') execute(add_bridge, 'br-data')
if config('data-port'):
execute(add_bridge_port, 'br-data',
config('data-port'))
def enable_shell(self, user): def enable_shell(self, user):
execute(enable_shell, user) execute(enable_shell, user)