From 54dd4229000a3a7c44ecdcbe436ed8cac3698e20 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Fri, 23 Nov 2018 09:50:48 +0800 Subject: [PATCH] Skip archive copying when pattern is blank Blank patterns are invalid patterns to be copying and causes lftools to incorrectly copy the entire current working directory. This patch detects that pattern and skips the pattern as a pattern to archive. Issue: RELENG-1512 Change-Id: Ia7b0ae4a5b1d6996919bfc2a10deea4c9db84f17 Signed-off-by: Thanh Ha --- lftools/deploy.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lftools/deploy.py b/lftools/deploy.py index 6f8128e8..e5b508de 100644 --- a/lftools/deploy.py +++ b/lftools/deploy.py @@ -172,6 +172,9 @@ def copy_archives(workspace, pattern=None): paths = [] for p in pattern: + if p == '': # Skip empty patterns as they are invalid + continue + search = os.path.join(workspace, p) paths.extend(glob2.glob(search, recursive=True)) log.debug('Files found: {}'.format(paths)) -- 2.16.6