Skip to content

Commit d5ba5a4

Browse files
authored
scionlab-config: log conflicts and skipped files (#372)
1 parent 00b2062 commit d5ba5a4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scionlab/hostfiles/scionlab-config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ def install_config(args, tar):
420420
if args.force and backup: # only warn in --force, otherwise user has already been prompted
421421
logging.warn("Overwriting files with local modifications, creating backup: %s",
422422
", ".join(_root(f) for f in backup))
423+
if args.keep and confnew: # only warn in --keep, ditto
424+
logging.warn("Skipping files with local modifications, installing updated file with "
425+
".confnew suffix: %s", ", ".join(_root(f) for f in confnew))
423426
backup_files(backup)
424427

425428
stop_scion()
@@ -485,6 +488,12 @@ def find_file_conflicts(old_files, new_files):
485488
for f, h in disk_files.items():
486489
if (f in new_files and h != new_files[f]) and (f not in old_files or h != old_files[f]):
487490
conflicts.append(f)
491+
492+
for f in conflicts:
493+
logging.debug(
494+
"File conflict for %s: disk: %s, new: %s, old: %s",
495+
_root(f), disk_files.get(f, "-"), new_files.get(f, "-"), old_files.get(f, "-")
496+
)
488497
return conflicts
489498

490499

0 commit comments

Comments
 (0)