Make it resync and remove import_opts

Change-Id: If40c429e80e0308e61c38d1aa2abfaba5d20dba6
This commit is contained in:
Endre Karlson 2013-06-25 23:46:10 +02:00
parent aaf69c7cf3
commit 82c0a77f1d
1 changed files with 2 additions and 17 deletions

View File

@ -19,14 +19,6 @@ cfg.CONF.register_cli_opt(cfg.StrOpt('services', default=SERVICES))
cfg.CONF.register_cli_opt(cfg.BoolOpt('resync', default=False))
def import_service_opts(service):
cfg.CONF.import_opt('storage_driver', 'billingstack.%s.storage' % service,
group='service:%s' % service)
cfg.CONF.import_opt('database_connection',
'billingstack.%s.storage.impl_sqlalchemy' % service,
group='%s:sqlalchemy' % service)
def resync_service_storage(service, resync=False):
"""
Resync the storage for a service
@ -40,14 +32,7 @@ def resync_service_storage(service, resync=False):
if __name__ == '__main__':
service.prepare_service(sys.argv)
try:
services = cfg.CONF.services
for svc in services:
import_service_opts(svc)
except Exception:
LOG.error('Error importing service options for %s, will exit' % svc)
sys.exit(0)
services = cfg.CONF.services
for svc in services:
LOG.info("Doing storage for %s" % svc)
resync_service_storage(svc)
resync_service_storage(svc, resync=cfg.CONF.resync)