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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,16 +1,14 @@
# -*- coding: utf-8 -*-
"""
prepare server
Plugin responsible for Server Preparation.
"""
import os
import re
import uuid
import logging
import platform
from packstack.installer import basedefs
from packstack.installer import exceptions
from packstack.installer import utils
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
#------------------ oVirt installer initialization ------------------
# ------------ Server Preparation Packstack Plugin Initialization -------------
PLUGIN_NAME = "OS-SERVERPREPARE"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
@ -372,7 +370,7 @@ def initSequences(controller):
controller.addSequence("Preparing servers", [], [], preparesteps)
#------------------------- helper functions -------------------------
# ------------------------- helper functions -------------------------
def is_rhel():
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
if proxy_server:
cmd = ('subscription-manager config '
'--server.proxy_hostname=%(proxy_server)s '
'--server.proxy_port=%(proxy_port)s')
'--server.proxy_hostname=%(proxy_server)s '
'--server.proxy_port=%(proxy_port)s')
if proxy_user:
cmd += (' --server.proxy_user=%(proxy_user)s '
'--server.proxy_password=%(proxy_password)s')
@ -598,7 +596,7 @@ def manage_rdo(host, config):
raise exceptions.ScriptRuntimeError(msg)
#-------------------------- step functions --------------------------
# -------------------------- step functions --------------------------
def server_prep(config, messages):
rh_username = None
@ -631,11 +629,11 @@ def server_prep(config, messages):
# Subscribe to Red Hat Repositories if configured
if rh_username:
run_rhsm_reg(hostname, rh_username, rh_password,
optional=(config.get('CONFIG_RH_OPTIONAL') == 'y'),
proxy_server=config.get('CONFIG_RH_PROXY'),
proxy_port=config.get('CONFIG_RH_PROXY_PORT'),
proxy_user=config.get('CONFIG_RH_PROXY_USER'),
proxy_password=config.get('CONFIG_RH_PROXY_PASSWORD'))
optional=(config.get('CONFIG_RH_OPTIONAL') == 'y'),
proxy_server=config.get('CONFIG_RH_PROXY'),
proxy_port=config.get('CONFIG_RH_PROXY_PORT'),
proxy_user=config.get('CONFIG_RH_PROXY_USER'),
proxy_password=config.get('CONFIG_RH_PROXY_PASSWORD'))
# Subscribe to RHN Satellite if configured
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
# these rpms are available from yum.
sos_rpms = ' '.join(('rhos-log-collector',
'sos',
'sos-plugins-openstack'))
'sos',
'sos-plugins-openstack'))
server.append('yum list available rhos-log-collector && '
'yum -y install %s || '

View File

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