forked from mirrors/thatmattlove-hyperglass
fixed incorrect path issue
This commit is contained in:
parent
f20c48fb1c
commit
2879bb1ca7
1 changed files with 10 additions and 12 deletions
|
|
@ -14,23 +14,21 @@ def ci_config():
|
||||||
logger.info("Migrating test config files...")
|
logger.info("Migrating test config files...")
|
||||||
config_dir = os.path.join(working_directory, "hyperglass/configuration/")
|
config_dir = os.path.join(working_directory, "hyperglass/configuration/")
|
||||||
test_files = glob.iglob(os.path.join(working_directory, "*.toml"))
|
test_files = glob.iglob(os.path.join(working_directory, "*.toml"))
|
||||||
|
config_files = glob.iglob(os.path.join(config_dir, "*.toml"))
|
||||||
logger.debug(config_dir)
|
logger.debug(config_dir)
|
||||||
status = False
|
status = False
|
||||||
for f in test_files:
|
for f in config_files:
|
||||||
logger.debug(f)
|
|
||||||
if os.path.exists(f):
|
if os.path.exists(f):
|
||||||
logger.debug(f"{f} already exists")
|
logger.debug(f"{f} already exists")
|
||||||
raise RuntimeError(f"{f} already exists")
|
raise RuntimeError(f"{f} already exists")
|
||||||
else:
|
for f in test_files:
|
||||||
try:
|
try:
|
||||||
shutil.copy(f, config_dir)
|
shutil.copy(f, config_dir)
|
||||||
logger.info("Successfully migrated test config files")
|
logger.info("Successfully migrated test config files")
|
||||||
status = True
|
status = True
|
||||||
logger.debug(status)
|
except:
|
||||||
return status
|
logger.error(f"Failed to migrate {f}")
|
||||||
except:
|
raise
|
||||||
logger.error(f"Failed to migrate {f}")
|
|
||||||
raise
|
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue