Esempio n. 1
0
def main():
    logger = listener_logging.initialize_logging()
    logger.error(
        "starting expired record cleaning loop, will remove records older than "
        "%s days every %s minutes" %
        (config.valid_profile_age_days, config.expired_cleaner_sleep_minutes))
    app = create_app()
    expired_record_cleaning_loop(app.app, logger)
Esempio n. 2
0
def main():
    logger = listener_logging.initialize_logging()
    logger.error("starting %s listener" % config.listener_type)

    app = create_app()

    if config.listener_type == "ARCHIVER":
        archiver_event_loop(app.app, logger)
    elif config.listener_type == "DELETER":
        deleter_event_loop(app.app, logger)
    else:
        logger.error("unable to detect listener type")
Esempio n. 3
0
 def setUp(self):
     self.rbac_patcher = patch(
         "historical_system_profiles.views.v1.view_helpers.ensure_has_role")
     patched_rbac = self.rbac_patcher.start()
     patched_rbac.return_value = None  # validate all RBAC requests
     self.addCleanup(self.stopPatches)
     test_connexion_app = app.create_app()
     test_flask_app = test_connexion_app.app
     self.client = test_flask_app.test_client()
     self.rbac_patcher = mock.patch(
         "historical_system_profiles.views.v1.view_helpers.ensure_has_role")
     patched_rbac = self.rbac_patcher.start()
     patched_rbac.return_value = None  # validate all RBAC requests
     self.addCleanup(self.stopPatches)
def main():
    logger = listener_logging.initialize_logging()
    logger.error("starting %s listener" % config.listener_type)

    start_metrics_server(config.listener_metrics_port)

    app = create_app()
    ptc = payload_tracker_interface.PayloadTrackerClient(logger)

    consumer = init_consumer("platform.inventory.events", logger)

    if config.listener_type == "ARCHIVER":
        archiver.event_loop(app.app, consumer, ptc, logger,
                            config.listener_delay)
    elif config.listener_type == "DELETER":
        deleter.event_loop(app.app, consumer, ptc, logger,
                           config.listener_delay)
    else:
        logger.error("unable to detect listener type")
Esempio n. 5
0
import os

from historical_system_profiles.app import create_app

port = os.getenv("PORT", 8080)

create_app().run(host="0.0.0.0", port=port)
Esempio n. 6
0
 def setUp(self):
     test_connexion_app = app.create_app()
     test_flask_app = test_connexion_app.app
     self.client = test_flask_app.test_client()
from historical_system_profiles.app import create_app


application = create_app()

if __name__ == "__main__":
    application.run()