Packstack Plugins Clean-up

- Deleted unused import
- Pep8 compliance
- Deleted unused variables

Change-Id: I45f135b2467427cd7ee3b5ba32745af2a631458a
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud
2014-11-30 18:30:22 +01:00
parent 8e1cecf63c
commit 3da12069ef
18 changed files with 231 additions and 289 deletions

View File

@@ -1,16 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Installs and configures amqp Installs and configures AMQP
""" """
import logging
import uuid
import os
from packstack.installer import validators from packstack.installer import validators
from packstack.installer import processors from packstack.installer import processors
from packstack.installer import basedefs
from packstack.installer import utils from packstack.installer import utils
from packstack.modules.common import filtered_hosts from packstack.modules.common import filtered_hosts
@@ -19,7 +14,7 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
createFirewallResources) createFirewallResources)
#------------------ oVirt installer initialization ------------------ # ------------- AMQP Packstack Plugin Initialization --------------
PLUGIN_NAME = "AMQP" PLUGIN_NAME = "AMQP"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -215,7 +210,7 @@ def initSequences(controller):
controller.addSequence("Installing AMQP", [], [], amqpsteps) controller.addSequence("Installing AMQP", [], [], amqpsteps)
#-------------------------- step functions -------------------------- # ------------------------ step functions -------------------------
def create_manifest(config, messages): def create_manifest(config, messages):
server = utils.ScriptRunner(config['CONFIG_AMQP_HOST']) server = utils.ScriptRunner(config['CONFIG_AMQP_HOST'])

View File

@@ -4,8 +4,6 @@
Installs and configures Ceilometer Installs and configures Ceilometer
""" """
import logging
import os
import uuid import uuid
from packstack.installer import utils from packstack.installer import utils
@@ -17,7 +15,7 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
createFirewallResources) createFirewallResources)
#------------------ oVirt installer initialization ------------------ # ------------- Ceilometer Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Ceilometer" PLUGIN_NAME = "OS-Ceilometer"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -106,7 +104,7 @@ def initSequences(controller):
steps) steps)
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_manifest(config, messages): def create_manifest(config, messages):
manifestfile = "%s_ceilometer.pp" % config['CONFIG_CONTROLLER_HOST'] manifestfile = "%s_ceilometer.pp" % config['CONFIG_CONTROLLER_HOST']

View File

@@ -4,17 +4,13 @@
Installs and configures Cinder Installs and configures Cinder
""" """
import os
import re import re
import uuid
import logging
from packstack.installer import exceptions from packstack.installer import exceptions
from packstack.installer import processors from packstack.installer import processors
from packstack.installer import validators from packstack.installer import validators
from packstack.installer.utils import split_hosts from packstack.installer.utils import split_hosts
from packstack.installer import basedefs
from packstack.installer import utils from packstack.installer import utils
@@ -23,11 +19,8 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
appendManifestFile, appendManifestFile,
createFirewallResources) createFirewallResources)
from packstack.installer import exceptions
from packstack.installer import output_messages
# ------------------ Cinder Packstack Plugin initialization ------------------
#------------------ oVirt installer initialization ------------------
PLUGIN_NAME = "OS-Cinder" PLUGIN_NAME = "OS-Cinder"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -453,7 +446,7 @@ def initConfig(controller):
{"CMD_OPTION": "cinder-netapp-sa-password", {"CMD_OPTION": "cinder-netapp-sa-password",
"USAGE": ("(optional) Password for the NetApp E-Series storage " "USAGE": ("(optional) Password for the NetApp E-Series storage "
"array. " "array. "
"Defaults to ''."), "Defaults to ''."),
"PROMPT": ("Enter a password"), "PROMPT": ("Enter a password"),
"OPTION_LIST": [""], "OPTION_LIST": [""],
"VALIDATORS": [], "VALIDATORS": [],
@@ -502,7 +495,7 @@ def initConfig(controller):
"USE_DEFAULT": True, "USE_DEFAULT": True,
"NEED_CONFIRM": False, "NEED_CONFIRM": False,
"CONDITION": False}, "CONDITION": False},
] ]
} }
conf_groups = [ conf_groups = [
@@ -527,62 +520,62 @@ def initConfig(controller):
"POST_CONDITION": False, "POST_CONDITION": False,
"POST_CONDITION_MATCH": True}, "POST_CONDITION_MATCH": True},
{"GROUP_NAME": "CINDERGLUSTERMOUNTS", {"GROUP_NAME": "CINDERGLUSTERMOUNTS",
"DESCRIPTION": "Cinder gluster Config parameters", "DESCRIPTION": "Cinder gluster Config parameters",
"PRE_CONDITION": check_gluster_options, "PRE_CONDITION": check_gluster_options,
"PRE_CONDITION_MATCH": True, "PRE_CONDITION_MATCH": True,
"POST_CONDITION": False, "POST_CONDITION": False,
"POST_CONDITION_MATCH": True}, "POST_CONDITION_MATCH": True},
{"GROUP_NAME": "CINDERNFSMOUNTS", {"GROUP_NAME": "CINDERNFSMOUNTS",
"DESCRIPTION": "Cinder NFS Config parameters", "DESCRIPTION": "Cinder NFS Config parameters",
"PRE_CONDITION": check_nfs_options, "PRE_CONDITION": check_nfs_options,
"PRE_CONDITION_MATCH": True, "PRE_CONDITION_MATCH": True,
"POST_CONDITION": False, "POST_CONDITION": False,
"POST_CONDITION_MATCH": True}, "POST_CONDITION_MATCH": True},
{"GROUP_NAME": "CINDERNETAPPMAIN", {"GROUP_NAME": "CINDERNETAPPMAIN",
"DESCRIPTION": "Cinder NetApp main configuration", "DESCRIPTION": "Cinder NetApp main configuration",
"PRE_CONDITION": check_netapp_options, "PRE_CONDITION": check_netapp_options,
"PRE_CONDITION_MATCH": True, "PRE_CONDITION_MATCH": True,
"POST_CONDITION": False, "POST_CONDITION": False,
"POST_CONDITION_MATCH": True}, "POST_CONDITION_MATCH": True},
{"GROUP_NAME": "CINDERNETAPPONTAPISCSI", {"GROUP_NAME": "CINDERNETAPPONTAPISCSI",
"DESCRIPTION": "Cinder NetApp ONTAP-iSCSI configuration", "DESCRIPTION": "Cinder NetApp ONTAP-iSCSI configuration",
"PRE_CONDITION": check_netapp_ontap_iscsi_options, "PRE_CONDITION": check_netapp_ontap_iscsi_options,
"PRE_CONDITION_MATCH": True, "PRE_CONDITION_MATCH": True,
"POST_CONDITION": False, "POST_CONDITION": False,
"POST_CONDITION_MATCH": True}, "POST_CONDITION_MATCH": True},
{"GROUP_NAME": "CINDERNETAPPNFS", {"GROUP_NAME": "CINDERNETAPPNFS",
"DESCRIPTION": "Cinder NetApp NFS configuration", "DESCRIPTION": "Cinder NetApp NFS configuration",
"PRE_CONDITION": check_netapp_nfs_settings, "PRE_CONDITION": check_netapp_nfs_settings,
"PRE_CONDITION_MATCH": True, "PRE_CONDITION_MATCH": True,
"POST_CONDITION": False, "POST_CONDITION": False,
"POST_CONDITION_MATCH": True}, "POST_CONDITION_MATCH": True},
{"GROUP_NAME": "CINDERNETAPPISCSI7MODE", {"GROUP_NAME": "CINDERNETAPPISCSI7MODE",
"DESCRIPTION": "Cinder NetApp iSCSI & 7-mode configuration", "DESCRIPTION": "Cinder NetApp iSCSI & 7-mode configuration",
"PRE_CONDITION": check_netapp_7modeiscsi_options, "PRE_CONDITION": check_netapp_7modeiscsi_options,
"PRE_CONDITION_MATCH": True, "PRE_CONDITION_MATCH": True,
"POST_CONDITION": False, "POST_CONDITION": False,
"POST_CONDITION_MATCH": True}, "POST_CONDITION_MATCH": True},
{"GROUP_NAME": "CINDERNETAPPVSERVER", {"GROUP_NAME": "CINDERNETAPPVSERVER",
"DESCRIPTION": "Cinder NetApp vServer configuration", "DESCRIPTION": "Cinder NetApp vServer configuration",
"PRE_CONDITION": check_netapp_vserver_options, "PRE_CONDITION": check_netapp_vserver_options,
"PRE_CONDITION_MATCH": True, "PRE_CONDITION_MATCH": True,
"POST_CONDITION": False, "POST_CONDITION": False,
"POST_CONDITION_MATCH": True}, "POST_CONDITION_MATCH": True},
{"GROUP_NAME": "CINDERNETAPPESERIES", {"GROUP_NAME": "CINDERNETAPPESERIES",
"DESCRIPTION": "Cinder NetApp E-Series configuration", "DESCRIPTION": "Cinder NetApp E-Series configuration",
"PRE_CONDITION": check_netapp_eseries_options, "PRE_CONDITION": check_netapp_eseries_options,
"PRE_CONDITION_MATCH": True, "PRE_CONDITION_MATCH": True,
"POST_CONDITION": False, "POST_CONDITION": False,
"POST_CONDITION_MATCH": True}, "POST_CONDITION_MATCH": True}
] ]
for group in conf_groups: for group in conf_groups:
params = conf_params[group["GROUP_NAME"]] params = conf_params[group["GROUP_NAME"]]
controller.addGroup(group, params) controller.addGroup(group, params)
@@ -620,7 +613,7 @@ def initSequences(controller):
controller.addSequence("Installing OpenStack Cinder", [], [], cinder_steps) controller.addSequence("Installing OpenStack Cinder", [], [], cinder_steps)
#------------------------- helper functions ------------------------- # ------------------------- helper functions -------------------------
def check_lvm_options(config): def check_lvm_options(config):
return (config['CONFIG_CINDER_INSTALL'] == 'y' and return (config['CONFIG_CINDER_INSTALL'] == 'y' and
@@ -677,7 +670,7 @@ def check_netapp_eseries_options(config):
config['CONFIG_CINDER_NETAPP_STORAGE_FAMILY'] == "eseries") config['CONFIG_CINDER_NETAPP_STORAGE_FAMILY'] == "eseries")
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def check_cinder_vg(config, messages): def check_cinder_vg(config, messages):
cinders_volume = 'cinder-volumes' cinders_volume = 'cinder-volumes'
@@ -700,7 +693,7 @@ def check_cinder_vg(config, messages):
"contain a cinder-volumes " "contain a cinder-volumes "
"volume group") "volume group")
match = re.match('^(?P<size>\d+)G$', match = re.match('^(?P<size>\d+)G$',
config['CONFIG_CINDER_VOLUMES_SIZE'].strip()) config['CONFIG_CINDER_VOLUMES_SIZE'].strip())
if not match: if not match:
msg = 'Invalid Cinder volumes VG size.' msg = 'Invalid Cinder volumes VG size.'
raise exceptions.ParamValidationError(msg) raise exceptions.ParamValidationError(msg)

View File

@@ -4,12 +4,10 @@
Installs and configures OpenStack Horizon Installs and configures OpenStack Horizon
""" """
import logging
import os import os
import uuid import uuid
from packstack.installer import validators from packstack.installer import validators
from packstack.installer import basedefs, output_messages
from packstack.installer import exceptions from packstack.installer import exceptions
from packstack.installer import utils from packstack.installer import utils
@@ -17,7 +15,7 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
appendManifestFile) appendManifestFile)
#------------------ oVirt installer initialization ------------------ # ------------- Horizon Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Horizon" PLUGIN_NAME = "OS-Horizon"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -115,7 +113,7 @@ def initSequences(controller):
controller.addSequence("Installing OpenStack Horizon", [], [], steps) controller.addSequence("Installing OpenStack Horizon", [], [], steps)
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_manifest(config, messages): def create_manifest(config, messages):
config["CONFIG_HORIZON_SECRET_KEY"] = uuid.uuid4().hex config["CONFIG_HORIZON_SECRET_KEY"] = uuid.uuid4().hex

View File

@@ -4,21 +4,16 @@
Installs and configures Glance Installs and configures Glance
""" """
import uuid
import logging
from packstack.installer import validators from packstack.installer import validators
from packstack.installer import processors from packstack.installer import processors
from packstack.installer import basedefs
from packstack.installer import utils from packstack.installer import utils
from packstack.installer.utils import split_hosts
from packstack.modules.shortcuts import get_mq from packstack.modules.shortcuts import get_mq
from packstack.modules.ospluginutils import (getManifestTemplate, from packstack.modules.ospluginutils import (getManifestTemplate,
appendManifestFile, appendManifestFile,
createFirewallResources) createFirewallResources)
#------------------ oVirt installer initialization ------------------ # ------------- Glance Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Glance" PLUGIN_NAME = "OS-Glance"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -98,7 +93,7 @@ def initSequences(controller):
controller.addSequence("Installing OpenStack Glance", [], [], glancesteps) controller.addSequence("Installing OpenStack Glance", [], [], glancesteps)
#------------------------- helper functions ------------------------- # ------------------------- helper functions -------------------------
def process_backend(value, param_name, config): def process_backend(value, param_name, config):
if value == 'swift' and config['CONFIG_SWIFT_INSTALL'] != 'y': if value == 'swift' and config['CONFIG_SWIFT_INSTALL'] != 'y':
@@ -106,7 +101,7 @@ def process_backend(value, param_name, config):
return value return value
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_keystone_manifest(config, messages): def create_keystone_manifest(config, messages):
if config['CONFIG_UNSUPPORTED'] != 'y': if config['CONFIG_UNSUPPORTED'] != 'y':

View File

@@ -1,12 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Installs and configures heat Installs and configures Heat
""" """
import uuid import uuid
import logging
import os
from packstack.installer import utils from packstack.installer import utils
from packstack.installer import validators from packstack.installer import validators
@@ -14,12 +12,11 @@ from packstack.installer import processors
from packstack.modules.shortcuts import get_mq from packstack.modules.shortcuts import get_mq
from packstack.modules.ospluginutils import (getManifestTemplate, from packstack.modules.ospluginutils import (getManifestTemplate,
manifestfiles,
appendManifestFile, appendManifestFile,
createFirewallResources) createFirewallResources)
#------------------ oVirt installer initialization ------------------ # ------------- Heat Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Heat" PLUGIN_NAME = "OS-Heat"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -171,7 +168,7 @@ def initSequences(controller):
controller.addSequence("Installing Heat", [], [], steps) controller.addSequence("Installing Heat", [], [], steps)
#-------------------------- step functions -------------------------- # ------------------------ step functions -------------------------
def create_manifest(config, messages): def create_manifest(config, messages):
manifestfile = "%s_heat.pp" % config['CONFIG_CONTROLLER_HOST'] manifestfile = "%s_heat.pp" % config['CONFIG_CONTROLLER_HOST']

View File

@@ -4,12 +4,10 @@
Installs and configures Keystone Installs and configures Keystone
""" """
import logging
import uuid import uuid
from packstack.installer import validators from packstack.installer import validators
from packstack.installer import processors from packstack.installer import processors
from packstack.installer import basedefs
from packstack.installer import utils from packstack.installer import utils
from packstack.modules.ospluginutils import (getManifestTemplate, from packstack.modules.ospluginutils import (getManifestTemplate,
@@ -17,7 +15,7 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
createFirewallResources) createFirewallResources)
#------------------ oVirt installer initialization ------------------ # ------------- Keystone Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Keystone" PLUGIN_NAME = "OS-Keystone"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -137,7 +135,7 @@ def initSequences(controller):
keystonesteps) keystonesteps)
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_manifest(config, messages): def create_manifest(config, messages):
manifestfile = "%s_keystone.pp" % config['CONFIG_CONTROLLER_HOST'] manifestfile = "%s_keystone.pp" % config['CONFIG_CONTROLLER_HOST']

View File

@@ -4,13 +4,9 @@
Installs and configures MariaDB Installs and configures MariaDB
""" """
import uuid
import logging
from packstack.installer import validators from packstack.installer import validators
from packstack.installer import processors from packstack.installer import processors
from packstack.installer import utils from packstack.installer import utils
from packstack.installer.utils import split_hosts
from packstack.modules.common import filtered_hosts from packstack.modules.common import filtered_hosts
from packstack.modules.ospluginutils import (getManifestTemplate, from packstack.modules.ospluginutils import (getManifestTemplate,
@@ -18,7 +14,7 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
createFirewallResources) createFirewallResources)
#------------------ oVirt installer initialization ------------------ # ------------- MariaDB Packstack Plugin Initialization --------------
PLUGIN_NAME = "MariaDB" PLUGIN_NAME = "MariaDB"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -88,7 +84,7 @@ def initSequences(controller):
controller.addSequence("Installing MariaDB", [], [], mariadbsteps) controller.addSequence("Installing MariaDB", [], [], mariadbsteps)
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_manifest(config, messages): def create_manifest(config, messages):
if config['CONFIG_MARIADB_INSTALL'] == 'y': if config['CONFIG_MARIADB_INSTALL'] == 'y':

View File

@@ -4,12 +4,8 @@
Installs and configures Nagios Installs and configures Nagios
""" """
import uuid
import logging
from packstack.installer import validators from packstack.installer import validators
from packstack.installer import processors from packstack.installer import processors
from packstack.installer import basedefs, output_messages
from packstack.installer import utils from packstack.installer import utils
from packstack.modules.common import filtered_hosts from packstack.modules.common import filtered_hosts
@@ -18,7 +14,7 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
createFirewallResources) createFirewallResources)
#------------------ oVirt installer initialization ------------------ # ------------- Nagios Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Nagios" PLUGIN_NAME = "OS-Nagios"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -62,7 +58,7 @@ def initSequences(controller):
controller.addSequence("Installing Nagios", [], [], nagiossteps) controller.addSequence("Installing Nagios", [], [], nagiossteps)
#------------------------- helper functions ------------------------- # ------------------------- helper functions -------------------------
def _serviceentry(**kwargs): def _serviceentry(**kwargs):
s = 'define service {\n' s = 'define service {\n'
@@ -90,7 +86,7 @@ def nagios_host(hostname, **kwargs):
return "%s}\n" % out return "%s}\n" % out
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_manifest(config, messages): def create_manifest(config, messages):
manifest_entries = '' manifest_entries = ''

View File

@@ -1,16 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Installs and configures neutron Installs and configures Neutron
""" """
import logging
import os
import re
import uuid
from packstack.installer import utils from packstack.installer import utils
from packstack.installer import exceptions
from packstack.installer import validators from packstack.installer import validators
from packstack.installer import processors from packstack.installer import processors
from packstack.installer import output_messages from packstack.installer import output_messages
@@ -23,7 +17,7 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
createFirewallResources) createFirewallResources)
#------------------ oVirt installer initialization ------------------ # ------------- Neutron Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Neutron" PLUGIN_NAME = "OS-Neutron"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -483,7 +477,7 @@ def initSequences(controller):
neutron_steps) neutron_steps)
#------------------------- helper functions ------------------------- # ------------------------- helper functions -------------------------
def neutron_install(config): def neutron_install(config):
return config['CONFIG_NEUTRON_INSTALL'] == 'y' return config['CONFIG_NEUTRON_INSTALL'] == 'y'
@@ -532,7 +526,7 @@ def get_values(val):
return [x.strip() for x in val.split(',')] if val else [] return [x.strip() for x in val.split(',')] if val else []
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_manifests(config, messages): def create_manifests(config, messages):
global q_hosts global q_hosts
@@ -649,7 +643,7 @@ def create_l3_manifests(config, messages):
appendManifestFile(manifestfile, manifestdata + '\n') appendManifestFile(manifestfile, manifestdata + '\n')
if config['CONFIG_NEUTRON_FWAAS'] == 'y': if config['CONFIG_NEUTRON_FWAAS'] == 'y':
# manifestfile = "%s_neutron_fwaas.pp" % (host,) # manifestfile = "%s_neutron_fwaas.pp" % (host,)
manifestdata = getManifestTemplate("neutron_fwaas.pp") manifestdata = getManifestTemplate("neutron_fwaas.pp")
appendManifestFile(manifestfile, manifestdata + '\n') appendManifestFile(manifestfile, manifestdata + '\n')
@@ -767,16 +761,16 @@ def create_l2_agent_manifests(config, messages):
appendManifestFile(manifestfile, manifestdata + "\n") appendManifestFile(manifestfile, manifestdata + "\n")
# neutron ovs port only on network hosts # neutron ovs port only on network hosts
if ( if (
agent == "openvswitch" and ( agent == "openvswitch" and (
(host in network_hosts and tunnel_types) (host in network_hosts and tunnel_types)
or 'vlan' in ovs_type) or 'vlan' in ovs_type)
): ):
bridge_key = 'CONFIG_NEUTRON_OVS_BRIDGE' bridge_key = 'CONFIG_NEUTRON_OVS_BRIDGE'
iface_key = 'CONFIG_NEUTRON_OVS_IFACE' iface_key = 'CONFIG_NEUTRON_OVS_IFACE'
for if_map in iface_arr: for if_map in iface_arr:
config[bridge_key], config[iface_key] = if_map.split(':') config[bridge_key], config[iface_key] = if_map.split(':')
manifestdata = getManifestTemplate("neutron_ovs_port.pp") manifestdata = getManifestTemplate("neutron_ovs_port.pp")
appendManifestFile(manifestfile, manifestdata + "\n") appendManifestFile(manifestfile, manifestdata + "\n")
# Additional configurations required for compute hosts and # Additional configurations required for compute hosts and
# network hosts. # network hosts.
manifestdata = getManifestTemplate('neutron_bridge_module.pp') manifestdata = getManifestTemplate('neutron_bridge_module.pp')

View File

@@ -1,12 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Installs and configures nova Installs and configures Nova
""" """
import os import os
import uuid
import logging
import platform import platform
import socket import socket
@@ -19,7 +17,7 @@ from packstack.modules.ospluginutils import (NovaConfig, getManifestTemplate,
createFirewallResources) createFirewallResources)
#------------------ oVirt installer initialization ------------------ # ------------- Nova Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Nova" PLUGIN_NAME = "OS-Nova"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -347,7 +345,7 @@ def initSequences(controller):
novaapisteps) novaapisteps)
#------------------------- helper functions ------------------------- # ------------------------- helper functions -------------------------
def check_ifcfg(host, device): def check_ifcfg(host, device):
""" """
@@ -381,7 +379,7 @@ def bring_up_ifcfg(host, device):
raise ScriptRuntimeError(msg) raise ScriptRuntimeError(msg)
#-------------------------- step functions -------------------------- # ------------------------ Step Functions -------------------------
def create_ssh_keys(config, messages): def create_ssh_keys(config, messages):
migration_key = os.path.join(basedefs.VAR_DIR, 'nova_migration_key') migration_key = os.path.join(basedefs.VAR_DIR, 'nova_migration_key')

View File

@@ -4,18 +4,15 @@
Installs and configures an OpenStack Client Installs and configures an OpenStack Client
""" """
import logging
import os import os
from packstack.installer import validators
from packstack.installer import basedefs, output_messages
from packstack.installer import utils from packstack.installer import utils
from packstack.modules.ospluginutils import (getManifestTemplate, from packstack.modules.ospluginutils import (getManifestTemplate,
appendManifestFile) appendManifestFile)
#------------------ oVirt installer initialization ------------------ # ------------- OpenStack Client Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Client" PLUGIN_NAME = "OS-Client"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -43,7 +40,7 @@ def initSequences(controller):
osclientsteps) osclientsteps)
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_manifest(config, messages): def create_manifest(config, messages):
client_host = config['CONFIG_CONTROLLER_HOST'].strip() client_host = config['CONFIG_CONTROLLER_HOST'].strip()

View File

@@ -1,11 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Installs and configures an OpenStack Client Plugin responsible for post-installation configuration
""" """
import logging
from packstack.installer import utils from packstack.installer import utils
from packstack.modules.common import filtered_hosts from packstack.modules.common import filtered_hosts
@@ -13,7 +11,7 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
appendManifestFile) appendManifestFile)
#------------------ oVirt installer initialization ------------------ # ------------- Postscript Packstack Plugin Initialization --------------
PLUGIN_NAME = "Postscript" PLUGIN_NAME = "Postscript"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -38,7 +36,7 @@ def initSequences(controller):
postscript_steps) postscript_steps)
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_manifest(config, messages): def create_manifest(config, messages):
for hostname in filtered_hosts(config): for hostname in filtered_hosts(config):

View File

@@ -5,7 +5,6 @@ Plugin responsible for setting OpenStack global options
""" """
import glob import glob
import logging
import os import os
import re import re
import uuid import uuid
@@ -18,7 +17,7 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
appendManifestFile) appendManifestFile)
#------------------ oVirt installer initialization ------------------ # ------------- Prescript Packstack Plugin Initialization --------------
PLUGIN_NAME = "Prescript" PLUGIN_NAME = "Prescript"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -31,18 +30,18 @@ def initConfig(controller):
"GLOBAL": [ "GLOBAL": [
{"CMD_OPTION": "ssh-public-key", {"CMD_OPTION": "ssh-public-key",
"USAGE": ( "USAGE": (
"Path to a Public key to install on servers. If a usable " "Path to a Public key to install on servers. If a usable "
"key has not been installed on the remote servers the user " "key has not been installed on the remote servers the user "
"will be prompted for a password and this key will be " "will be prompted for a password and this key will be "
"installed so the password will not be required again" "installed so the password will not be required again"
), ),
"PROMPT": ( "PROMPT": (
"Enter the path to your ssh Public key to install on servers" "Enter the path to your ssh Public key to install on servers"
), ),
"OPTION_LIST": [], "OPTION_LIST": [],
"VALIDATORS": [ "VALIDATORS": [
validators.validate_file, validators.validate_file,
validators.validate_sshkey validators.validate_sshkey
], ],
"PROCESSORS": [processors.process_ssh_key], "PROCESSORS": [processors.process_ssh_key],
"DEFAULT_VALUE": default_ssh_key, "DEFAULT_VALUE": default_ssh_key,
@@ -55,13 +54,13 @@ def initConfig(controller):
{"CMD_OPTION": "default-password", {"CMD_OPTION": "default-password",
"USAGE": ( "USAGE": (
"Set a default password everywhere. The default password " "Set a default password everywhere. The default password "
"will be overriden by whatever password is set for each " "will be overriden by whatever password is set for each "
"individual service or user." "individual service or user."
), ),
"PROMPT": ( "PROMPT": (
"Enter a default password to be used. Leave blank for a " "Enter a default password to be used. Leave blank for a "
"randomly generated one." "randomly generated one."
), ),
"OPTION_LIST": [], "OPTION_LIST": [],
"DEFAULT_VALUE": '', "DEFAULT_VALUE": '',
@@ -74,7 +73,7 @@ def initConfig(controller):
{"CMD_OPTION": "mariadb-install", {"CMD_OPTION": "mariadb-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install MariaDB" "Set to 'y' if you would like Packstack to install MariaDB"
), ),
"PROMPT": "Should Packstack install MariaDB", "PROMPT": "Should Packstack install MariaDB",
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
@@ -90,11 +89,11 @@ def initConfig(controller):
{"CMD_OPTION": "os-glance-install", {"CMD_OPTION": "os-glance-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install " "Set to 'y' if you would like Packstack to install "
"OpenStack Image Service (Glance)" "OpenStack Image Service (Glance)"
), ),
"PROMPT": ( "PROMPT": (
"Should Packstack install OpenStack Image Service (Glance)" "Should Packstack install OpenStack Image Service (Glance)"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options], "VALIDATORS": [validators.validate_options],
@@ -108,12 +107,12 @@ def initConfig(controller):
{"CMD_OPTION": "os-cinder-install", {"CMD_OPTION": "os-cinder-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install " "Set to 'y' if you would like Packstack to install "
"OpenStack Block Storage (Cinder)" "OpenStack Block Storage (Cinder)"
), ),
"PROMPT": ( "PROMPT": (
"Should Packstack install OpenStack Block Storage " "Should Packstack install OpenStack Block Storage "
"(Cinder) service" "(Cinder) service"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options], "VALIDATORS": [validators.validate_options],
@@ -127,11 +126,11 @@ def initConfig(controller):
{"CMD_OPTION": "os-nova-install", {"CMD_OPTION": "os-nova-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install " "Set to 'y' if you would like Packstack to install "
"OpenStack Compute (Nova)" "OpenStack Compute (Nova)"
), ),
"PROMPT": ( "PROMPT": (
"Should Packstack install OpenStack Compute (Nova) service" "Should Packstack install OpenStack Compute (Nova) service"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options], "VALIDATORS": [validators.validate_options],
@@ -145,13 +144,13 @@ def initConfig(controller):
{"CMD_OPTION": "os-neutron-install", {"CMD_OPTION": "os-neutron-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install " "Set to 'y' if you would like Packstack to install "
"OpenStack Networking (Neutron). Otherwise Nova Network " "OpenStack Networking (Neutron). Otherwise Nova Network "
"will be used." "will be used."
), ),
"PROMPT": ( "PROMPT": (
"Should Packstack install OpenStack Networking (Neutron) " "Should Packstack install OpenStack Networking (Neutron) "
"service" "service"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options], "VALIDATORS": [validators.validate_options],
@@ -165,11 +164,11 @@ def initConfig(controller):
{"CMD_OPTION": "os-horizon-install", {"CMD_OPTION": "os-horizon-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install " "Set to 'y' if you would like Packstack to install "
"OpenStack Dashboard (Horizon)" "OpenStack Dashboard (Horizon)"
), ),
"PROMPT": ( "PROMPT": (
"Should Packstack install OpenStack Dashboard (Horizon)" "Should Packstack install OpenStack Dashboard (Horizon)"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options], "VALIDATORS": [validators.validate_options],
@@ -183,11 +182,11 @@ def initConfig(controller):
{"CMD_OPTION": "os-swift-install", {"CMD_OPTION": "os-swift-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install " "Set to 'y' if you would like Packstack to install "
"OpenStack Object Storage (Swift)" "OpenStack Object Storage (Swift)"
), ),
"PROMPT": ( "PROMPT": (
"Should Packstack install OpenStack Object Storage (Swift)" "Should Packstack install OpenStack Object Storage (Swift)"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options], "VALIDATORS": [validators.validate_options],
@@ -201,11 +200,11 @@ def initConfig(controller):
{"CMD_OPTION": "os-ceilometer-install", {"CMD_OPTION": "os-ceilometer-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install " "Set to 'y' if you would like Packstack to install "
"OpenStack Metering (Ceilometer)" "OpenStack Metering (Ceilometer)"
), ),
"PROMPT": ( "PROMPT": (
"Should Packstack install OpenStack Metering (Ceilometer)" "Should Packstack install OpenStack Metering (Ceilometer)"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options], "VALIDATORS": [validators.validate_options],
@@ -219,11 +218,11 @@ def initConfig(controller):
{"CMD_OPTION": "os-heat-install", {"CMD_OPTION": "os-heat-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install " "Set to 'y' if you would like Packstack to install "
"OpenStack Orchestration (Heat)" "OpenStack Orchestration (Heat)"
), ),
"PROMPT": ( "PROMPT": (
"Should Packstack install OpenStack Orchestration (Heat)" "Should Packstack install OpenStack Orchestration (Heat)"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options], "VALIDATORS": [validators.validate_options],
@@ -237,9 +236,9 @@ def initConfig(controller):
{"CMD_OPTION": "os-client-install", {"CMD_OPTION": "os-client-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install " "Set to 'y' if you would like Packstack to install "
"the OpenStack Client packages. An admin \"rc\" file will " "the OpenStack Client packages. An admin \"rc\" file will "
"also be installed" "also be installed"
), ),
"PROMPT": "Should Packstack install OpenStack client tools", "PROMPT": "Should Packstack install OpenStack client tools",
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
@@ -269,12 +268,12 @@ def initConfig(controller):
{"CMD_OPTION": "nagios-install", {"CMD_OPTION": "nagios-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install Nagios " "Set to 'y' if you would like Packstack to install Nagios "
"to monitor OpenStack hosts" "to monitor OpenStack hosts"
), ),
"PROMPT": ( "PROMPT": (
"Should Packstack install Nagios to monitor OpenStack " "Should Packstack install Nagios to monitor OpenStack "
"hosts" "hosts"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options], "VALIDATORS": [validators.validate_options],
@@ -288,15 +287,15 @@ def initConfig(controller):
{"CMD_OPTION": "exclude-servers", {"CMD_OPTION": "exclude-servers",
"USAGE": ( "USAGE": (
"Comma separated list of servers to be excluded from " "Comma separated list of servers to be excluded from "
"installation in case you are running Packstack the second " "installation in case you are running Packstack the second "
"time with the same answer file and don't want Packstack " "time with the same answer file and don't want Packstack "
"to touch these servers. Leave plain if you don't need to " "to touch these servers. Leave plain if you don't need to "
"exclude any server." "exclude any server."
), ),
"PROMPT": ( "PROMPT": (
"Enter a comma separated list of server(s) to be excluded." "Enter a comma separated list of server(s) to be excluded."
" Leave plain if you don't need to exclude any server." " Leave plain if you don't need to exclude any server."
), ),
"OPTION_LIST": [], "OPTION_LIST": [],
"DEFAULT_VALUE": '', "DEFAULT_VALUE": '',
@@ -309,8 +308,8 @@ def initConfig(controller):
{"CMD_OPTION": "os-debug-mode", {"CMD_OPTION": "os-debug-mode",
"USAGE": ( "USAGE": (
"Set to 'y' if you want to run OpenStack services in debug " "Set to 'y' if you want to run OpenStack services in debug "
"mode. Otherwise set to 'n'." "mode. Otherwise set to 'n'."
), ),
"PROMPT": "Do you want to run OpenStack services in debug mode", "PROMPT": "Do you want to run OpenStack services in debug mode",
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
@@ -326,9 +325,9 @@ def initConfig(controller):
{"CONF_NAME": "CONFIG_CONTROLLER_HOST", {"CONF_NAME": "CONFIG_CONTROLLER_HOST",
"CMD_OPTION": "os-controller-host", "CMD_OPTION": "os-controller-host",
"USAGE": ( "USAGE": (
"The IP address of the server on which to install OpenStack" "The IP address of the server on which to install OpenStack"
" services specific to controller role such as API servers," " services specific to controller role such as API servers,"
" Horizon, etc." " Horizon, etc."
), ),
"PROMPT": "Enter the IP address of the controller host", "PROMPT": "Enter the IP address of the controller host",
"OPTION_LIST": [], "OPTION_LIST": [],
@@ -359,12 +358,12 @@ def initConfig(controller):
{"CONF_NAME": "CONFIG_COMPUTE_HOSTS", {"CONF_NAME": "CONFIG_COMPUTE_HOSTS",
"CMD_OPTION": "os-compute-hosts", "CMD_OPTION": "os-compute-hosts",
"USAGE": ( "USAGE": (
"The list of IP addresses of the server on which to install" "The list of IP addresses of the server on which to install"
" the Nova compute service" " the Nova compute service"
), ),
"PROMPT": ( "PROMPT": (
"Enter list of IP addresses on which to install compute " "Enter list of IP addresses on which to install compute "
"service" "service"
), ),
"OPTION_LIST": [], "OPTION_LIST": [],
"VALIDATORS": [validators.validate_multi_ip, "VALIDATORS": [validators.validate_multi_ip,
@@ -400,12 +399,12 @@ def initConfig(controller):
{"CMD_OPTION": "os-vmware", {"CMD_OPTION": "os-vmware",
"USAGE": ( "USAGE": (
"Set to 'y' if you want to use VMware vCenter as hypervisor" "Set to 'y' if you want to use VMware vCenter as hypervisor"
" and storage. Otherwise set to 'n'." " and storage. Otherwise set to 'n'."
), ),
"PROMPT": ( "PROMPT": (
"Do you want to use VMware vCenter as hypervisor and " "Do you want to use VMware vCenter as hypervisor and "
"datastore" "datastore"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"DEFAULT_VALUE": "n", "DEFAULT_VALUE": "n",
@@ -419,12 +418,12 @@ def initConfig(controller):
{"CMD_OPTION": "os-vmware", {"CMD_OPTION": "os-vmware",
"USAGE": ( "USAGE": (
"Set to 'y' if you want to use VMware vCenter as hypervisor" "Set to 'y' if you want to use VMware vCenter as hypervisor"
" and storage. Otherwise set to 'n'." " and storage. Otherwise set to 'n'."
), ),
"PROMPT": ( "PROMPT": (
"Do you want to use VMware vCenter as hypervisor and " "Do you want to use VMware vCenter as hypervisor and "
"datastore" "datastore"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"DEFAULT_VALUE": "n", "DEFAULT_VALUE": "n",
@@ -438,14 +437,14 @@ def initConfig(controller):
{"CMD_OPTION": "unsupported", {"CMD_OPTION": "unsupported",
"USAGE": ( "USAGE": (
"Set to 'y' if you want to use unsupported parameters. " "Set to 'y' if you want to use unsupported parameters. "
"This should be used only if you know what you are doing." "This should be used only if you know what you are doing."
"Issues caused by using unsupported options won't be fixed " "Issues caused by using unsupported options won't be fixed "
"before next major release." "before next major release."
), ),
"PROMPT": ( "PROMPT": (
"Enable this on your own risk. Do you want to use unsupported " "Enable this on your own risk. Do you want to use "
"parameters" "insupported parameters"
), ),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],
"DEFAULT_VALUE": "n", "DEFAULT_VALUE": "n",
@@ -462,8 +461,8 @@ def initConfig(controller):
{"CMD_OPTION": "vcenter-host", {"CMD_OPTION": "vcenter-host",
"USAGE": "The IP address of the VMware vCenter server", "USAGE": "The IP address of the VMware vCenter server",
"PROMPT": ( "PROMPT": (
"Enter the IP address of the VMware vCenter server to use " "Enter the IP address of the VMware vCenter server to use "
"with Nova" "with Nova"
), ),
"OPTION_LIST": [], "OPTION_LIST": [],
"VALIDATORS": [validators.validate_ip], "VALIDATORS": [validators.validate_ip],
@@ -515,9 +514,9 @@ def initConfig(controller):
{"CONF_NAME": "CONFIG_STORAGE_HOST", {"CONF_NAME": "CONFIG_STORAGE_HOST",
"CMD_OPTION": "os-storage-host", "CMD_OPTION": "os-storage-host",
"USAGE": ( "USAGE": (
"(Unsupported!) The IP address of the server on which " "(Unsupported!) The IP address of the server on which "
"to install OpenStack services specific to storage servers " "to install OpenStack services specific to storage servers "
"such as Glance and Cinder." "such as Glance and Cinder."
), ),
"PROMPT": "Enter the IP address of the storage host", "PROMPT": "Enter the IP address of the storage host",
"OPTION_LIST": [], "OPTION_LIST": [],
@@ -588,7 +587,7 @@ def initSequences(controller):
prescript_steps) prescript_steps)
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def install_keys_on_host(hostname, sshkeydata): def install_keys_on_host(hostname, sshkeydata):
server = utils.ScriptRunner(hostname) server = utils.ScriptRunner(hostname)

View File

@@ -1,12 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Installs and configures neutron Installs and configures Provisioning for demo usage and testing
""" """
import logging
import uuid
from packstack.installer import utils from packstack.installer import utils
from packstack.installer import validators from packstack.installer import validators
from packstack.installer import processors from packstack.installer import processors
@@ -16,7 +13,7 @@ from packstack.modules.ospluginutils import (appendManifestFile,
getManifestTemplate) getManifestTemplate)
#------------------ oVirt installer initialization ------------------ # ------------- Provision Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Provision" PLUGIN_NAME = "OS-Provision"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -82,20 +79,20 @@ def initConfig(controller):
"CONDITION": False}, "CONDITION": False},
{"CMD_OPTION": "provision-tempest-user-passwd", {"CMD_OPTION": "provision-tempest-user-passwd",
"USAGE": "The password to use for the Tempest Provisioning user", "USAGE": "The password to use for the Tempest Provisioning user",
"PROMPT": "Enter the password for the Tempest Provisioning user", "PROMPT": "Enter the password for the Tempest Provisioning user",
"OPTION_LIST": [], "OPTION_LIST": [],
"VALIDATORS": [validators.validate_not_empty], "VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": "PW_PLACEHOLDER", "DEFAULT_VALUE": "PW_PLACEHOLDER",
"PROCESSORS": [processors.process_password], "PROCESSORS": [processors.process_password],
"MASK_INPUT": True, "MASK_INPUT": True,
"LOOSE_VALIDATION": False, "LOOSE_VALIDATION": False,
"CONF_NAME": "CONFIG_PROVISION_TEMPEST_USER_PW", "CONF_NAME": "CONFIG_PROVISION_TEMPEST_USER_PW",
"USE_DEFAULT": False, "USE_DEFAULT": False,
"NEED_CONFIRM": True, "NEED_CONFIRM": True,
"CONDITION": False}, "CONDITION": False},
], ],
"PROVISION_DEMO": [ "PROVISION_DEMO": [
{"CMD_OPTION": "provision-demo-floatrange", {"CMD_OPTION": "provision-demo-floatrange",
@@ -125,7 +122,7 @@ def initConfig(controller):
"USE_DEFAULT": False, "USE_DEFAULT": False,
"NEED_CONFIRM": False, "NEED_CONFIRM": False,
"CONDITION": False}, "CONDITION": False},
], ],
"TEMPEST_GIT_REFS": [ "TEMPEST_GIT_REFS": [
{"CMD_OPTION": "provision-tempest-repo-uri", {"CMD_OPTION": "provision-tempest-repo-uri",
@@ -209,7 +206,7 @@ def initConfig(controller):
"PRE_CONDITION_MATCH": True, "PRE_CONDITION_MATCH": True,
"POST_CONDITION": False, "POST_CONDITION": False,
"POST_CONDITION_MATCH": True}, "POST_CONDITION_MATCH": True},
] ]
for group in conf_groups: for group in conf_groups:
paramList = conf_params[group["GROUP_NAME"]] paramList = conf_params[group["GROUP_NAME"]]
controller.addGroup(group, paramList) controller.addGroup(group, paramList)
@@ -232,7 +229,7 @@ def initSequences(controller):
config = controller.CONF config = controller.CONF
if (config['CONFIG_PROVISION_DEMO'] != "y" and if (config['CONFIG_PROVISION_DEMO'] != "y" and
config['CONFIG_PROVISION_TEMPEST'] != "y"): config['CONFIG_PROVISION_TEMPEST'] != "y"):
return return
provision_steps = [] provision_steps = []
@@ -249,9 +246,9 @@ def initSequences(controller):
'functions': [create_tempest_manifest]} 'functions': [create_tempest_manifest]}
) )
provision_steps.append( provision_steps.append(
{'title': 'Adding Provisioning Glance manifest entries', {'title': 'Adding Provisioning Glance manifest entries',
'functions': [create_storage_manifest]} 'functions': [create_storage_manifest]}
) )
marshall_conf_bool(config, 'CONFIG_PROVISION_TEMPEST') marshall_conf_bool(config, 'CONFIG_PROVISION_TEMPEST')
marshall_conf_bool(config, 'CONFIG_PROVISION_ALL_IN_ONE_OVS_BRIDGE') marshall_conf_bool(config, 'CONFIG_PROVISION_ALL_IN_ONE_OVS_BRIDGE')
@@ -260,7 +257,7 @@ def initSequences(controller):
[], [], provision_steps) [], [], provision_steps)
#------------------------- helper functions ------------------------- # ------------------------- helper functions -------------------------
def marshall_conf_bool(conf, key): def marshall_conf_bool(conf, key):
if conf[key] == 'y': if conf[key] == 'y':
@@ -285,7 +282,7 @@ def using_neutron(config):
marshall_conf_bool(config, 'PROVISION_NEUTRON_AVAILABLE') marshall_conf_bool(config, 'PROVISION_NEUTRON_AVAILABLE')
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_demo_manifest(config, messages): def create_demo_manifest(config, messages):
using_neutron(config) using_neutron(config)

View File

@@ -1,26 +1,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Installs and configures puppet Installs and configures Puppet
""" """
import sys import sys
import logging import logging
import os import os
import platform
import time import time
from packstack.installer import utils from packstack.installer import utils
from packstack.installer import basedefs, output_messages from packstack.installer import basedefs
from packstack.installer.exceptions import ScriptRuntimeError, PuppetError from packstack.installer.exceptions import ScriptRuntimeError, PuppetError
from packstack.modules.common import filtered_hosts from packstack.modules.common import filtered_hosts
from packstack.modules.ospluginutils import (manifestfiles, from packstack.modules.ospluginutils import (manifestfiles,
generateHieraDataFile) generateHieraDataFile)
from packstack.modules.puppet import scan_logfile, validate_logfile from packstack.modules.puppet import scan_logfile, validate_logfile
#------------------ oVirt installer initialization ------------------ # ------------- Puppet Packstack Plugin Initialization --------------
PLUGIN_NAME = "Puppet" PLUGIN_NAME = "Puppet"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -60,7 +59,7 @@ def initSequences(controller):
controller.addSequence("Puppet", [], [], puppetsteps) controller.addSequence("Puppet", [], [], puppetsteps)
#------------------------- helper functions ------------------------- # ------------------------- helper functions -------------------------
def wait_for_puppet(currently_running, messages): def wait_for_puppet(currently_running, messages):
log_len = 0 log_len = 0
@@ -121,7 +120,7 @@ def wait_for_puppet(currently_running, messages):
raise raise
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def run_cleanup(config, messages): def run_cleanup(config, messages):
localserver = utils.ScriptRunner() localserver = utils.ScriptRunner()
@@ -151,10 +150,8 @@ def install_deps(config, messages):
for hostname in filtered_hosts(config): for hostname in filtered_hosts(config):
server = utils.ScriptRunner(hostname) server = utils.ScriptRunner(hostname)
packages = ' '.join(deps) packages = ' '.join(deps)
server.append("yum install -y %s" server.append("yum install -y %s" % packages)
% packages) server.append("yum update -y %s" % packages)
server.append("yum update -y %s"
% packages)
# yum does not fail if one of the packages is missing # yum does not fail if one of the packages is missing
for package in deps: for package in deps:
server.append("rpm -q --whatprovides %s" % (package)) server.append("rpm -q --whatprovides %s" % (package))

View File

@@ -1,16 +1,14 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
prepare server Plugin responsible for Server Preparation.
""" """
import os import os
import re import re
import uuid
import logging import logging
import platform import platform
from packstack.installer import basedefs
from packstack.installer import exceptions from packstack.installer import exceptions
from packstack.installer import utils from packstack.installer import utils
from packstack.installer import validators from packstack.installer import validators
@@ -18,7 +16,7 @@ from packstack.installer import validators
from packstack.modules.common import filtered_hosts, is_all_in_one from packstack.modules.common import filtered_hosts, is_all_in_one
#------------------ oVirt installer initialization ------------------ # ------------ Server Preparation Packstack Plugin Initialization -------------
PLUGIN_NAME = "OS-SERVERPREPARE" PLUGIN_NAME = "OS-SERVERPREPARE"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -372,7 +370,7 @@ def initSequences(controller):
controller.addSequence("Preparing servers", [], [], preparesteps) controller.addSequence("Preparing servers", [], [], preparesteps)
#------------------------- helper functions ------------------------- # ------------------------- helper functions -------------------------
def is_rhel(): def is_rhel():
return 'Red Hat Enterprise Linux' in platform.linux_distribution()[0] return 'Red Hat Enterprise Linux' in platform.linux_distribution()[0]
@@ -452,8 +450,8 @@ def run_rhsm_reg(host, username, password, optional=False, proxy_server=None,
# configure proxy if it is necessary # configure proxy if it is necessary
if proxy_server: if proxy_server:
cmd = ('subscription-manager config ' cmd = ('subscription-manager config '
'--server.proxy_hostname=%(proxy_server)s ' '--server.proxy_hostname=%(proxy_server)s '
'--server.proxy_port=%(proxy_port)s') '--server.proxy_port=%(proxy_port)s')
if proxy_user: if proxy_user:
cmd += (' --server.proxy_user=%(proxy_user)s ' cmd += (' --server.proxy_user=%(proxy_user)s '
'--server.proxy_password=%(proxy_password)s') '--server.proxy_password=%(proxy_password)s')
@@ -598,7 +596,7 @@ def manage_rdo(host, config):
raise exceptions.ScriptRuntimeError(msg) raise exceptions.ScriptRuntimeError(msg)
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def server_prep(config, messages): def server_prep(config, messages):
rh_username = None rh_username = None
@@ -631,11 +629,11 @@ def server_prep(config, messages):
# Subscribe to Red Hat Repositories if configured # Subscribe to Red Hat Repositories if configured
if rh_username: if rh_username:
run_rhsm_reg(hostname, rh_username, rh_password, run_rhsm_reg(hostname, rh_username, rh_password,
optional=(config.get('CONFIG_RH_OPTIONAL') == 'y'), optional=(config.get('CONFIG_RH_OPTIONAL') == 'y'),
proxy_server=config.get('CONFIG_RH_PROXY'), proxy_server=config.get('CONFIG_RH_PROXY'),
proxy_port=config.get('CONFIG_RH_PROXY_PORT'), proxy_port=config.get('CONFIG_RH_PROXY_PORT'),
proxy_user=config.get('CONFIG_RH_PROXY_USER'), proxy_user=config.get('CONFIG_RH_PROXY_USER'),
proxy_password=config.get('CONFIG_RH_PROXY_PASSWORD')) proxy_password=config.get('CONFIG_RH_PROXY_PASSWORD'))
# Subscribe to RHN Satellite if configured # Subscribe to RHN Satellite if configured
if sat_url and hostname not in sat_registered: if sat_url and hostname not in sat_registered:
@@ -649,8 +647,8 @@ def server_prep(config, messages):
# Installing rhos-log-collector and sos-plugins-openstack if # Installing rhos-log-collector and sos-plugins-openstack if
# these rpms are available from yum. # these rpms are available from yum.
sos_rpms = ' '.join(('rhos-log-collector', sos_rpms = ' '.join(('rhos-log-collector',
'sos', 'sos',
'sos-plugins-openstack')) 'sos-plugins-openstack'))
server.append('yum list available rhos-log-collector && ' server.append('yum list available rhos-log-collector && '
'yum -y install %s || ' 'yum -y install %s || '

View File

@@ -1,19 +1,17 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Installs and configures an OpenStack Swift Installs and configures Swift
""" """
import os import os
import re import re
import uuid import uuid
import logging
import netaddr import netaddr
from packstack.installer import validators from packstack.installer import validators
from packstack.installer import processors from packstack.installer import processors
from packstack.installer.exceptions import ParamValidationError from packstack.installer.exceptions import ParamValidationError
from packstack.installer import basedefs
from packstack.installer import utils from packstack.installer import utils
from packstack.installer.utils import split_hosts from packstack.installer.utils import split_hosts
@@ -22,7 +20,7 @@ from packstack.modules.ospluginutils import (getManifestTemplate,
createFirewallResources) createFirewallResources)
#------------------ oVirt installer initialization ------------------ # ------------- Swift Packstack Plugin Initialization --------------
PLUGIN_NAME = "OS-Swift" PLUGIN_NAME = "OS-Swift"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@@ -163,7 +161,7 @@ def initSequences(controller):
controller.addSequence("Installing OpenStack Swift", [], [], steps) controller.addSequence("Installing OpenStack Swift", [], [], steps)
#------------------------- helper functions ------------------------- # ------------------------- helper functions -------------------------
def validate_storage(param, options=None): def validate_storage(param, options=None):
if not param: if not param:
@@ -246,7 +244,7 @@ def get_storage_size(config):
return intsize return intsize
#-------------------------- step functions -------------------------- # -------------------------- step functions --------------------------
def create_keystone_manifest(config, messages): def create_keystone_manifest(config, messages):
# parse devices in first step # parse devices in first step