From f252a5d32130368cbe1f39382629aa6a36ccc9bb Mon Sep 17 00:00:00 2001 From: Artem Osadchyi Date: Wed, 5 Aug 2015 15:37:52 +0300 Subject: [PATCH] Fix MapR plugin versions loading Ignore "__pycache__" and empty directories when trying to load MapR plugin versions Closes-Bug: #1481746 Change-Id: I22ef5e85b269a2090d69c5293330683135f44109 --- sahara/plugins/mapr/versions/version_handler_factory.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sahara/plugins/mapr/versions/version_handler_factory.py b/sahara/plugins/mapr/versions/version_handler_factory.py index cc905c13..40bb770a 100644 --- a/sahara/plugins/mapr/versions/version_handler_factory.py +++ b/sahara/plugins/mapr/versions/version_handler_factory.py @@ -21,7 +21,11 @@ def _load_versions(): m_template = 'sahara.plugins.mapr.versions.%s.version_handler' def predicate(v_dir): - return os.path.isdir(os.path.join(d_name, v_dir)) + if v_dir != "__pycache__": + v_dir = os.path.join(d_name, v_dir) + return os.path.isdir(v_dir) and os.listdir(v_dir) + + return False def mapper(v_dir): return m_template % v_dir