Some cleanups around imports and making written scripts executable.

This commit is contained in:
Joshua Harlow 2012-02-13 17:53:14 -08:00
parent 6b1ff60ac1
commit a06220a9ec
7 changed files with 17 additions and 16 deletions

View File

@ -14,6 +14,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import time
from devstack import component as comp
from devstack import exceptions as excp
from devstack import log as logging
@ -22,8 +24,6 @@ from devstack import shell as sh
from devstack import trace as tr
from devstack import utils
import time
#id
TYPE = settings.DB
LOG = logging.getLogger("devstack.components.db")

View File

@ -27,24 +27,26 @@ LOG = logging.getLogger("devstack.components.horizon")
#actual dir names
ROOT_HORIZON = 'horizon'
HORIZON_NAME = 'horizon'
ROOT_DASH = 'openstack-dashboard'
#name used for python install trace
HORIZON_NAME = ROOT_HORIZON
DASH_NAME = 'dashboard'
#config files messed with
HORIZON_PY_CONF = "horizon_settings.py"
HORIZON_PY_CONF_TGT = ['local', 'local_settings.py']
HORIZON_APACHE_CONF = '000-default'
CONFIGS = [HORIZON_PY_CONF, HORIZON_APACHE_CONF]
#http://wiki.apache.org/httpd/DistrosDefaultLayout
#TODO: maybe this should be a subclass that handles these differences
APACHE_CONF_TARGETS = {
settings.UBUNTU11: '/etc/apache2/sites-enabled/000-default',
#ensure runs after wsgi.conf
#ensure runs after wsgi.conf (naming wise)
settings.RHEL6: '/etc/httpd/conf.d/wsgi-horizon-000-default.conf',
settings.FEDORA16: '/etc/httpd/conf.d/wsgi-horizon-000-default.conf',
}
CONFIGS = [HORIZON_PY_CONF, HORIZON_APACHE_CONF]
#db sync that needs to happen for horizon
DB_SYNC_CMD = ['python', 'manage.py', 'syncdb']

View File

@ -121,13 +121,16 @@ class KeystoneInstaller(comp.PythonInstallComponent):
def _setup_data(self):
LOG.info("Configuring data setup template %s.", MANAGE_DATA_CONF)
#first write it
(_, contents) = utils.load_template(self.component_name, MANAGE_DATA_CONF)
params = self._get_param_map(MANAGE_DATA_CONF)
contents = utils.param_replace(contents, params, True)
tgt_fn = sh.joinpths(self.bindir, MANAGE_DATA_CONF)
sh.write_file(tgt_fn, contents)
# This environment additions are important
# in that they eventually affect how this script runs
sh.chmod(tgt_fn, 755)
#now run it
#these environment additions are important
#in that they eventually affect how this script runs
env = dict()
env['ENABLED_SERVICES'] = ",".join(self.instances.keys())
env['BIN_DIR'] = self.bindir

View File

@ -298,6 +298,7 @@ class NovaInstaller(comp.PythonInstallComponent):
(_, contents) = utils.load_template(self.component_name, CLEANER_DATA_CONF)
tgt_fn = sh.joinpths(self.bindir, CLEANER_DATA_CONF)
sh.write_file(tgt_fn, contents)
sh.chmod(tgt_fn, 755)
self.tracewriter.file_touched(tgt_fn)
def _setup_db(self):

View File

@ -44,10 +44,6 @@ CONFIGS = [SWIFT_CONF, PROXY_SERVER_CONF, ACCOUNT_SERVER_CONF,
BIN_DIR = 'bin'
CONFIG_DIR = 'etc'
# what to start
APP_OPTIONS = {
}
#the pkg json files swift requires for installation
REQ_PKGS = ['general.json', 'swift.json']

View File

@ -22,6 +22,9 @@ import sys
#but the colors make it worth it :-)
from termcolor import colored
# methods
getLogger = logging.getLogger
class TermFormatter(logging.Formatter):
def __init__(self, reg_fmt, date_format):
@ -59,7 +62,3 @@ class TermHandler(logging.Handler):
TermHandler.STREAM.write(msg + TermHandler.NL)
if TermHandler.DO_FLUSH:
TermHandler.STREAM.flush()
def getLogger(name):
return logging.getLogger(name)

View File

@ -10,7 +10,7 @@ import json
import logging
import optparse
import os
import re
import re
# Configure logging