added glance scrubber

This commit is contained in:
Joshua Harlow 2012-03-06 15:49:11 -08:00
parent ef538e6811
commit 53d22ed6d0
4 changed files with 53 additions and 7 deletions

@ -0,0 +1,3 @@
[app:glance-scrubber]
paste.app_factory = glance.common.wsgi:app_factory
glance.app_factory = glance.store.scrubber:Scrubber

@ -0,0 +1,35 @@
[DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = True
# Show debugging output in logs (sets DEBUG log level output)
debug = False
# Log to this file. Make sure you do not set the same log
# file for both the API and registry servers!
log_file = /var/log/glance/scrubber.log
# Send logs to syslog (/dev/log) instead of to file specified by `log_file`
use_syslog = False
# Should we run our own loop or rely on cron/scheduler to run us
daemon = False
# Loop time between checking for new items to schedule for delete
wakeup_time = 300
# Directory that the scrubber will use to remind itself of what to delete
# Make sure this is also set in glance-api.conf
scrubber_datadir = /var/lib/glance/scrubber
# Only one server in your deployment should be designated the cleanup host
cleanup_scrubber = False
# pending_delete items older than this time are candidates for cleanup
cleanup_scrubber_time = 86400
# Address to find the registry server for cleanups
registry_host = 0.0.0.0
# Port the registry server is listening on
registry_port = 9191

@ -41,16 +41,19 @@ API_CONF = "glance-api.conf"
REG_CONF = "glance-registry.conf"
API_PASTE_CONF = 'glance-api-paste.ini'
REG_PASTE_CONF = 'glance-registry-paste.ini'
SCRUB_CONF = 'glance-scrubber.conf'
SCRUB_PASTE_CONF = 'glance-scrubber-paste.ini'
LOGGING_CONF = "logging.conf"
LOGGING_SOURCE_FN = 'logging.cnf.sample'
POLICY_JSON = 'policy.json'
CONFIGS = [API_CONF, REG_CONF, API_PASTE_CONF,
REG_PASTE_CONF, POLICY_JSON, LOGGING_CONF]
READ_CONFIGS = [API_CONF, REG_CONF, API_PASTE_CONF, REG_PASTE_CONF]
REG_PASTE_CONF, POLICY_JSON, LOGGING_CONF, SCRUB_CONF, SCRUB_PASTE_CONF]
READ_CONFIGS = [API_CONF, REG_CONF, API_PASTE_CONF, REG_PASTE_CONF, SCRUB_CONF, SCRUB_PASTE_CONF]
#reg, api are here as possible subcomponents
GAPI = "api"
GREG = "reg"
GSCR = 'scrub'
#this db will be dropped and created
DB_NAME = "glance"
@ -62,13 +65,15 @@ WAIT_ONLINE_TO = settings.WAIT_ALIVE_SECS
#what to start
APP_OPTIONS = {
'glance-api': ['--config-file', sh.joinpths('%ROOT%', "etc", API_CONF)],
'glance-registry': ['--config-file', sh.joinpths('%ROOT%', "etc", REG_CONF)]
'glance-registry': ['--config-file', sh.joinpths('%ROOT%', "etc", REG_CONF)],
'glance-scrubber': ['--config-file', sh.joinpths('%ROOT%', "etc", REG_CONF)],
}
#how the subcompoent small name translates to an actual app
SUB_TO_APP = {
GAPI: 'glance-api',
GREG: 'glance-registry'
GREG: 'glance-registry',
GSCR: 'glance-scrubber',
}
#subdirs of the downloaded

@ -41,13 +41,15 @@ LOG = logging.getLogger('devstack.components.nova')
#special generated conf
API_CONF = 'nova.conf'
#how we reference some config files (in applications)
CFG_FILE_OPT = '--config-file'
#normal conf
PASTE_CONF = 'nova-api-paste.ini'
PASTE_SOURCE_FN = 'api-paste.ini'
POLICY_CONF = 'policy.json'
LOGGING_SOURCE_FN = 'logging_sample.conf'
LOGGING_CONF = "logging.conf"
CFG_FILE_OPT = '--config-file'
CONFIGS = [PASTE_CONF, POLICY_CONF, LOGGING_CONF]
ADJUST_CONFIGS = [PASTE_CONF]
@ -60,8 +62,7 @@ DB_NAME = 'nova'
#this makes the database be in sync with nova
DB_SYNC_CMD = [
{'cmd': ['%BINDIR%/nova-manage', CFG_FILE_OPT, '%CFGFILE%',
'db', 'sync']},
{'cmd': ['%BINDIR%/nova-manage', CFG_FILE_OPT, '%CFGFILE%', 'db', 'sync']},
]
#these are used for nova volumens
@ -745,6 +746,8 @@ class NovaConfConfigurator(object):
converted_flags = list()
for f in extra_flags:
cleaned_opt = f.lstrip("-")
if len(cleaned_opt) == 0:
continue
if cleaned_opt.find("=") == -1:
cleaned_opt += "=%s" % (True)
converted_flags.append(cleaned_opt)