def main(): _register_cli_opts() common_setup(config=config, setup_db=True, register_mq_exchanges=False) # Get config values timestamp = cfg.CONF.timestamp action_ref = cfg.CONF.action_ref purge_incomplete = cfg.CONF.purge_incomplete if not timestamp: LOG.error('Please supply a timestamp for purging models. Aborting.') return 1 else: timestamp = datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%S.%fZ') timestamp = timestamp.replace(tzinfo=pytz.UTC) try: purge_executions(logger=LOG, timestamp=timestamp, action_ref=action_ref, purge_incomplete=purge_incomplete) except Exception as e: LOG.exception(str(e)) return FAILURE_EXIT_CODE finally: common_teardown() return SUCCESS_EXIT_CODE
def setup(argv): common_setup( config=config, setup_db=False, register_mq_exchanges=False, register_internal_trigger_types=False, )
def main(argv): _register_cli_opts() # Parse CLI args, set up logging common_setup(config=config, setup_db=False, register_mq_exchanges=False, register_internal_trigger_types=False) packs = cfg.CONF.pack verify_ssl = cfg.CONF.verify_ssl force = cfg.CONF.force use_python3 = cfg.CONF.use_python3 proxy_config = get_and_set_proxy_config() for pack in packs: LOG.info('Installing pack "%s"' % (pack)) result = download_pack(pack=pack, verify_ssl=verify_ssl, force=force, proxy_config=proxy_config, force_permissions=True, use_python3=use_python3) # Raw pack name excluding the version pack_name = result[1] success = result[2][0] if success: LOG.info('Successfully installed pack "%s"' % (pack_name)) else: error = result[2][1] LOG.error('Failed to installed pack "%s": %s' % (pack_name, error)) sys.exit(2) return 0
def main(argv): _register_cli_opts() # Parse CLI args, set up logging common_setup(config=config, setup_db=False, register_mq_exchanges=False, register_internal_trigger_types=False) packs = cfg.CONF.pack verify_ssl = cfg.CONF.verify_ssl force = cfg.CONF.force proxy_config = get_and_set_proxy_config() for pack in packs: LOG.info('Installing pack "%s"' % (pack)) result = download_pack(pack=pack, verify_ssl=verify_ssl, force=force, proxy_config=proxy_config, force_permissions=True) # Raw pack name excluding the version pack_name = result[1] success = result[2][0] if success: LOG.info('Successfully installed pack "%s"' % (pack_name)) else: error = result[2][1] LOG.error('Failed to installed pack "%s": %s' % (pack_name, error)) sys.exit(2) return 0
def main(argv): _register_cli_opts() # Parse CLI args, set up logging common_setup(config=config, setup_db=False, register_mq_exchanges=False, register_internal_trigger_types=False) packs = cfg.CONF.pack update = cfg.CONF.update use_python3 = cfg.CONF.python3 proxy_config = get_and_set_proxy_config() for pack in packs: # Setup pack virtual environment LOG.info('Setting up virtualenv for pack "%s"' % (pack)) setup_pack_virtualenv(pack_name=pack, update=update, logger=LOG, proxy_config=proxy_config, use_python3=use_python3, no_download=True) LOG.info('Successfully set up virtualenv for pack "%s"' % (pack)) return 0
def setup(argv): common_setup( config=config, setup_db=True, register_mq_exchanges=True, register_internal_trigger_types=True, ignore_register_config_opts_errors=True, )
def main(argv): _register_cli_opts() # Parse CLI args, set up logging common_setup(config=config, setup_db=False, register_mq_exchanges=False, register_internal_trigger_types=False) packs = cfg.CONF.pack verify_ssl = cfg.CONF.verify_ssl force = cfg.CONF.force use_python3 = cfg.CONF.use_python3 proxy_config = get_and_set_proxy_config() for pack in packs: # 1. Download the pack LOG.info('Installing pack "%s"' % (pack)) result = download_pack(pack=pack, verify_ssl=verify_ssl, force=force, proxy_config=proxy_config, force_permissions=True, use_python3=use_python3) # Raw pack name excluding the version pack_name = result[1] success = result[2][0] if success: LOG.info('Successfully installed pack "%s"' % (pack_name)) else: error = result[2][1] LOG.error('Failed to install pack "%s": %s' % (pack_name, error)) sys.exit(2) # 2. Setup pack virtual environment LOG.info('Setting up virtualenv for pack "%s"' % (pack_name)) setup_pack_virtualenv(pack_name=pack_name, update=False, logger=LOG, proxy_config=proxy_config, use_python3=use_python3, no_download=True) LOG.info('Successfully set up virtualenv for pack "%s"' % (pack_name)) return 0
def main(): _register_cli_opts() common_setup(config=config, setup_db=True, register_mq_exchanges=False) # Get config values timestamp = cfg.CONF.timestamp if not timestamp: LOG.error('Please supply a timestamp for purging models. Aborting.') return 1 else: timestamp = datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%S.%fZ') timestamp = timestamp.replace(tzinfo=pytz.UTC) # Purge models. purge_trigger_instances(timestamp=timestamp) common_teardown()
def main(): _register_cli_opts() common_setup(config=config, setup_db=True, register_mq_exchanges=False) try: tester = RuleTester(rule_file_path=cfg.CONF.rule, rule_ref=cfg.CONF.rule_ref, trigger_instance_file_path=cfg.CONF.trigger_instance, trigger_instance_id=cfg.CONF.trigger_instance_id) matches = tester.evaluate() finally: common_teardown() if matches: LOG.info('=== RULE MATCHES ===') sys.exit(0) else: LOG.info('=== RULE DOES NOT MATCH ===') sys.exit(1)
def main(): _register_cli_opts() common_setup(config=config, setup_db=True, register_mq_exchanges=False) # Get config values timestamp = cfg.CONF.timestamp action_ref = cfg.CONF.action_ref purge_incomplete = cfg.CONF.purge_incomplete if not timestamp: LOG.error("Please supply a timestamp for purging models. Aborting.") return 1 else: timestamp = datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S.%fZ") timestamp = timestamp.replace(tzinfo=pytz.UTC) # Purge models. purge_executions(timestamp=timestamp, action_ref=action_ref, purge_incomplete=purge_incomplete) common_teardown()
def main(): _register_cli_opts() common_setup(config=config, setup_db=True, register_mq_exchanges=False) # Get config values timestamp = cfg.CONF.timestamp if not timestamp: LOG.error('Please supply a timestamp for purging models. Aborting.') return 1 else: timestamp = datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%S.%fZ') timestamp = timestamp.replace(tzinfo=pytz.UTC) # Purge models. try: purge_trigger_instances(logger=LOG, timestamp=timestamp) except Exception as e: LOG.exception(six.text_type(e)) return FAILURE_EXIT_CODE finally: common_teardown() return SUCCESS_EXIT_CODE
def setup(argv): common_setup(config=config, setup_db=True, register_mq_exchanges=True)
def main(): common_setup(config=config, setup_db=False, register_mq_exchanges=False) setup_pack_virtualenv(cfg.CONF.pack, logger=LOG) common_teardown()
def setup(argv): common_setup(config=config, setup_db=True, register_mq_exchanges=True, register_internal_trigger_types=True)
def setup(): common_setup(config=config, setup_db=False, register_mq_exchanges=False)