From ef1394f4d1cc6b042057d4f071f6765d09f18c2a Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 13 Jan 2014 22:07:05 +0100 Subject: [PATCH] filter out special/hidden files when iterating over explorers Signed-off-by: Steven Armstrong --- cdist/core/explorer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cdist/core/explorer.py b/cdist/core/explorer.py index d926552a..14dac9f6 100644 --- a/cdist/core/explorer.py +++ b/cdist/core/explorer.py @@ -79,7 +79,7 @@ class Explorer(object): def list_global_explorer_names(self): """Return a list of global explorer names.""" - return os.listdir(self.local.global_explorer_path) + return glob.glob1(self.local.global_explorer_path, '*') def run_global_explorers(self, out_path): """Run global explorers and save output to files in the given @@ -111,7 +111,7 @@ class Explorer(object): """Return a list of explorer names for the given type.""" source = os.path.join(self.local.type_path, cdist_type.explorer_path) try: - return os.listdir(source) + return glob.glob1(source, '*') except EnvironmentError: return []