Merge "container_startup_config: remove old startup config files" into stable/train

This commit is contained in:
Zuul 2020-07-14 18:17:37 +00:00 committed by Gerrit Code Review
commit 52bd6827bd
1 changed files with 7 additions and 2 deletions

View File

@ -16,6 +16,7 @@
# under the License. # under the License.
__metaclass__ = type __metaclass__ = type
import glob
import json import json
import os import os
import shutil import shutil
@ -122,9 +123,13 @@ class ContainerStartupManager:
self.results['changed'] = True self.results['changed'] = True
def _cleanup_old_configs(self): def _cleanup_old_configs(self):
"""Cleanup old container configurations and directories. """Cleanup old container configurations from previous releases.
""" """
# TODO(emilien) remove old .json in /var/lib/tripleo-config/*.json pattern = '*docker-container-startup-config*.json'
old_configs = glob.glob(os.path.join('/var/lib/tripleo-config',
pattern))
for config in old_configs:
os.remove(config)
def main(): def main():