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')
@@ -581,7 +574,7 @@ def initConfig(controller):
"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"]]
@@ -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'

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')

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')
@@ -444,8 +443,8 @@ def initConfig(controller):
"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",
@@ -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')
@@ -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,17 +1,16 @@
# -*- 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
@@ -20,7 +19,7 @@ from packstack.modules.ospluginutils import (manifestfiles,
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]
@@ -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

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