def action_loaddefault(params): from nailgun.db.sqlalchemy import fixman from nailgun.logger import logger logger.info("Uploading fixture...") fixman.upload_fixtures() logger.info("Done")
def action_loaddefault(params): from nailgun.db.sqlalchemy import fixman from nailgun.logger import logger logger.info("Uploading fixture...") fixman.upload_fixtures() logger.info("Applying fake deployment tasks to all releases...") fixman.load_fake_deployment_tasks() logger.info("Done")
def clear_nailgun_database(): from nailgun.db import dropdb from nailgun.db import syncdb from nailgun.db.sqlalchemy import fixman dropdb() syncdb() fixman.upload_fixtures() for fixture in NAILGUN_FIXTURES.split(':'): if fixture == '': continue with open(fixture, "r") as fileobj: fixman.upload_fixture(fileobj)
logger.info("Done") elif params.action == "test": logger.info("Running tests...") from nailgun.unit_test import TestRunner TestRunner.run() logger.info("Done") elif params.action == "loaddata": logger.info("Uploading fixture...") from nailgun.db.sqlalchemy import fixman with open(params.fixture, "r") as fileobj: fixman.upload_fixture(fileobj) logger.info("Done") elif params.action == "loaddefault": logger.info("Uploading fixture...") from nailgun.db.sqlalchemy import fixman fixman.upload_fixtures() logger.info("Done") elif params.action == "dump_settings": sys.stdout.write(settings.dump()) elif params.action in ("run", ): settings.update({ 'LISTEN_PORT': int(params.port), 'LISTEN_ADDRESS': params.address, }) for attr in [ 'FAKE_TASKS', 'FAKE_TASKS_TICK_COUNT', 'FAKE_TASKS_TICK_INTERVAL', 'FAKE_TASKS_AMQP' ]: param = getattr(params, attr.lower()) if param is not None: settings.update({attr: param})
logger.info("Done") elif params.action == "test": logger.info("Running tests...") from nailgun.unit_test import TestRunner TestRunner.run() logger.info("Done") elif params.action == "loaddata": logger.info("Uploading fixture...") from nailgun.db.sqlalchemy import fixman with open(params.fixture, "r") as fileobj: fixman.upload_fixture(fileobj) logger.info("Done") elif params.action == "loaddefault": logger.info("Uploading fixture...") from nailgun.db.sqlalchemy import fixman fixman.upload_fixtures() logger.info("Done") elif params.action == "dump_settings": sys.stdout.write(settings.dump()) elif params.action in ("run",): settings.update({ 'LISTEN_PORT': int(params.port), 'LISTEN_ADDRESS': params.address, }) for attr in ['FAKE_TASKS', 'FAKE_TASKS_TICK_COUNT', 'FAKE_TASKS_TICK_INTERVAL', 'FAKE_TASKS_AMQP']: param = getattr(params, attr.lower()) if param is not None: settings.update({attr: param}) if params.config_file: settings.update_from_file(params.config_file)