diff options
author | Holger Weiß <holger@zedat.fu-berlin.de> | 2011-07-05 23:55:25 +0200 |
---|---|---|
committer | Holger Weiß <holger@zedat.fu-berlin.de> | 2011-07-05 23:55:25 +0200 |
commit | b0639bb7effd411a28fd7950b11a1a5cbe43161e (patch) | |
tree | 0045b64fb9e73e64c4aef21eefc290dcfa338706 /src | |
parent | beb1b5a34759bd3cc3f5c577b30bf880f30905a8 (diff) | |
download | bcfg2-b0639bb7effd411a28fd7950b11a1a5cbe43161e.tar.gz bcfg2-b0639bb7effd411a28fd7950b11a1a5cbe43161e.tar.bz2 bcfg2-b0639bb7effd411a28fd7950b11a1a5cbe43161e.zip |
bcfg2-admin compare -r: Check for removed files
When the "-r" flag is used, check for files which are present in the old
directory but not in the new directory (not just the other way round).
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Server/Admin/Compare.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/Server/Admin/Compare.py b/src/lib/Server/Admin/Compare.py index 27e1478d1..e6b273176 100644 --- a/src/lib/Server/Admin/Compare.py +++ b/src/lib/Server/Admin/Compare.py @@ -124,7 +124,11 @@ class Compare(Bcfg2.Server.Admin.Mode): args.remove('-r') (oldd, newd) = args (old, new) = [os.listdir(spot) for spot in args] + old_extra = [] for item in old: + if item not in new: + old_extra.append(item) + continue print("File: %s" % item) state = self.__call__([oldd + '/' + item, newd + '/' + item]) new.remove(item) @@ -134,6 +138,8 @@ class Compare(Bcfg2.Server.Admin.Mode): print("File %s is bad" % item) if new: print("%s has extra files: %s" % (newd, ', '.join(new))) + if old_extra: + print("%s has extra files: %s" % (oldd, ', '.join(old_extra))) return try: (old, new) = args |