Fix MapR plugin versions loading

Ignore "__pycache__" and empty directories
when trying to load MapR plugin versions

Closes-Bug: #1481746
Change-Id: I22ef5e85b269a2090d69c5293330683135f44109
This commit is contained in:
Artem Osadchyi 2015-08-05 15:37:52 +03:00
parent 18552b720b
commit f252a5d321

View File

@ -21,7 +21,11 @@ def _load_versions():
m_template = 'sahara.plugins.mapr.versions.%s.version_handler' m_template = 'sahara.plugins.mapr.versions.%s.version_handler'
def predicate(v_dir): 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): def mapper(v_dir):
return m_template % v_dir return m_template % v_dir