From c4f94e31a9928a653f48cb700d54f84d4556ddbf Mon Sep 17 00:00:00 2001 From: John Fulton Date: Tue, 20 Nov 2018 14:35:46 -0500 Subject: [PATCH] Do not fail deploy for empty ceph ansible fetch directory The RestoreTempDirFromSwift action returned an error if the Swift container is empty which can stop a deployment. However there are legitimate reasons the Swift container could be empty for which the deployment should not be stopped. Change-Id: Ic2d9f31caaacbf1c83c4c716cd5e282c6a1953f0 Closes-Bug: #1803609 (cherry picked from commit e05349d55aaa9c423ec6a0f610fdb8842c0d224e) --- tripleo_common/actions/files.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tripleo_common/actions/files.py b/tripleo_common/actions/files.py index aa69a06fb..c05933c8e 100644 --- a/tripleo_common/actions/files.py +++ b/tripleo_common/actions/files.py @@ -147,6 +147,7 @@ class RestoreTempDirFromSwift(base.TripleOAction): ^/tmp/file-mistral-action[A-Za-z0-9_]{6}$ Container should contain a single tarball object + If container is empty, then no error is returned """ def __init__(self, path, container): @@ -165,7 +166,9 @@ class RestoreTempDirFromSwift(base.TripleOAction): try: swiftutils.download_container(swift, self.container, self.path) filenames = os.listdir(self.path) - if len(filenames) == 1: + if len(filenames) == 0: + pass + elif len(filenames) == 1: tarball.extract_tarball(self.path, filenames[0], remove=True) else: msg = "%d objects found in container: %s" \