Commit a68a4a45 authored by Rafael Monnerat's avatar Rafael Monnerat

slapgrid: Remove .timestamp and .slapgrid always if partition is destroyed.

parent 251b63f5
...@@ -1094,6 +1094,14 @@ stderr_logfile_backups=1 ...@@ -1094,6 +1094,14 @@ stderr_logfile_backups=1
software_url = None software_url = None
if computer_partition_state == COMPUTER_PARTITION_DESTROYED_STATE and \ if computer_partition_state == COMPUTER_PARTITION_DESTROYED_STATE and \
not software_url: not software_url:
# Exclude files which may come from concurrent processing
# ie.: slapos ndoe report and slapos node instance commands
# can create a .timestamp file.
file_list = os.listdir(computer_partition_path)
for garbage_file in [".slapgrid", ".timestamp"]:
if garbage_file in file_list:
shutil.rmtree(garbage_file)
if os.listdir(computer_partition_path) != []: if os.listdir(computer_partition_path) != []:
self.logger.warning("Free partition %s contains file(s) in %s." % ( self.logger.warning("Free partition %s contains file(s) in %s." % (
computer_partition.getId(), computer_partition_path)) computer_partition.getId(), computer_partition_path))
......
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