Commit 851b2deb authored by Xavier Thompson's avatar Xavier Thompson

slapgrid: Ignore slapformat dump file in warning

Running slapformat creates a `.slapos-resource` file in each partition.
Running slapgrid emits a warning if a free partition dir is not empty.

With this commit, slapgrid only emits a warning if a free partition
contains entries other than the slapformat dump file.
parent a3a69655
......@@ -1307,7 +1307,8 @@ stderr_logfile_backups=1
else:
shutil.rmtree(garbage_path)
if os.listdir(computer_partition_path) != []:
# Ignore .slapos-resource file dumped by slapformat.
if os.listdir(computer_partition_path) not in ([], ['.slapos-resource']):
self.logger.warning("Free partition %s contains file(s) in %s." % (
computer_partition.getId(), computer_partition_path))
continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment