def load_config_file_and_sync(config_filename): global logger config_handler = config.ConfigHandler(sync_config.SyncConfig()) tool_sync_config = config_handler.read_config_file(config_filename) sync_tool = sync.SyncTool(tool_sync_config) try: sync_tool.scan() except Exception as e: logger.error("Exception %s during scan" % str(e)) return try: sync_tool.sync() except Exception as e: logger.error("Exception %s during sync" % str(e))
def test(): config_handler = config.ConfigHandler(sync_config.SyncConfig()) sample_config = config_handler.read_config_file( 'etc/gitsynchista_config_sample') sample_config.dump()
def test(): global logger logger.info("Start test") config_handler = config.ConfigHandler(sync_config.SyncConfig()) sample_config = config_handler.read_config_file( 'etc/gitsynchista_config_sample') sample_config.dump() logger.info("End test")
def find_sync_configs(base_path='..'): config_filenames = [] configs = [] for (dirpath, dirnames, filenames) in os.walk(base_path, topdown=True, onerror=None, followlinks=False): for filename in filenames: if filename == GITSYNCHISTA_CONFIG_FILE: config_filenames.append(os.path.join(dirpath, filename)) for filename in config_filenames: config_handler = config.ConfigHandler(sync_config.SyncConfig()) a_sync_config = config_handler.read_config_file(filename) configs.append(a_sync_config) return configs