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

@@ -11,6 +11,7 @@ from packstack.installer import validators
from packstack.installer.exceptions import ParamValidationError
from packstack.installer import basedefs
from packstack.installer import utils
from packstack.installer.utils import split_hosts
from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile, manifestfiles
@@ -278,13 +279,10 @@ def createstoragemanifest(config):
controller.CONF["SWIFT_STORAGE_DEVICES"] = "'%s'"%devicename
manifestdata = "\n" + getManifestTemplate("swift_loopback.pp")
# Allowed host list for firewall
hosts = set()
for host in config['CONFIG_SWIFT_STORAGE_HOSTS'].split(','):
hosts.add(host.strip())
for host in config['CONFIG_SWIFT_PROXY_HOSTS'].split(','):
hosts.add(host.strip())
for host in config['CONFIG_NOVA_COMPUTE_HOSTS'].split(','):
hosts.add(host.strip())
hosts = split_hosts(config['CONFIG_SWIFT_STORAGE_HOSTS'])
hosts |= split_hosts(config['CONFIG_SWIFT_PROXY_HOSTS'])
if config['CONFIG_NOVA_INSTALL'] == 'y':
hosts |= split_hosts(config['CONFIG_NOVA_COMPUTE_HOSTS'])
config['FIREWALL_ALLOWED'] = ",".join(["'%s'" % i for i in hosts])
# Firewall rules for storage and rsync
config['FIREWALL_SERVICE_NAME'] = "swift storage and rsync"