Fixes errors when nova is disabled

This patch checks if nova is disabled in some
plugins so we can run packstack with
CONFIG_NOVA_INSTALL=n

Added also an ALL option to the firewall
template.

Change-Id: I05a9bd55c89d4009e28307248d74624533d47240
Fixes: rhbz#987888 rhbz#1024564 rhbz#1026795
This commit is contained in:
Ivan Chavero
2013-11-06 09:59:59 -07:00
parent bb48532631
commit 768ee0d856
11 changed files with 67 additions and 38 deletions

View File

@@ -4,7 +4,8 @@ from .datastructures import SortedDict
from .decorators import retry
from .network import get_localhost_ip, host2ip, force_ip, device_from_ip
from .shell import ScriptRunner, execute
from .shortcuts import host_iter, hosts, get_current_user, get_current_username
from .shortcuts import host_iter, hosts, get_current_user,\
get_current_username, split_hosts
from .strings import COLORS, color_text, mask_string
@@ -13,4 +14,4 @@ __all__ = ('SortedDict',
'get_localhost_ip', 'host2ip', 'force_ip', 'device_from_ip',
'ScriptRunner', 'execute',
'host_iter', 'hosts', 'get_current_user', 'get_current_username',
'COLORS', 'color_text', 'mask_string')
'split_hosts', 'COLORS', 'color_text', 'mask_string')

View File

@@ -38,3 +38,12 @@ def get_current_username():
user = pwd.getpwuid(uid).pw_name
group = grp.getgrgid(gid).gr_name
return user, group
def split_hosts(hosts_string):
hosts = set()
for host in hosts_string.split(','):
shost = host.strip()
if shost:
hosts.add(shost)
return hosts