From 8f35ff5f0f7c85d619537596cd49b90cfb16fc1b Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 11 Feb 2021 10:07:04 -0800 Subject: [PATCH] Just use CLOUD_NAMES as env variable CLOUD_NAMES vs CLOUD_NAME is a one character difference which may be easily overlooked. The split method will work even with only one item and no ','. And in Zuul we already have the convention of describing an input that accepts one or more items with a plural noun. Change-Id: I28b8b6be2b536d627bf77665b5c3e583000efbda --- zuul_storage_proxy/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/zuul_storage_proxy/__init__.py b/zuul_storage_proxy/__init__.py index fca6e70..1240391 100644 --- a/zuul_storage_proxy/__init__.py +++ b/zuul_storage_proxy/__init__.py @@ -186,10 +186,7 @@ class CloudCache(object): self.log = logging.getLogger('middleware') self.app = app - if 'CLOUD_NAME' in os.environ: - cloud_names = [os.environ['CLOUD_NAME']] - else: - cloud_names = os.environ['CLOUD_NAMES'].split(',') + cloud_names = os.environ['CLOUD_NAMES'].split(',') self.clouds = [] for cloud_name in cloud_names: