From c5793b90c8f695048efbd43a0488559c2755afa4 Mon Sep 17 00:00:00 2001
From: Marco Clemencic <marco.clemencic@cern.ch>
Date: Fri, 27 Jan 2017 17:58:13 +0100
Subject: [PATCH] fix permission of files generated by glimpseindex

---
 python/LbNightlyTools/Scripts/Index.py | 11 ++++++++---
 python/LbNightlyTools/Utils.py         |  2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/python/LbNightlyTools/Scripts/Index.py b/python/LbNightlyTools/Scripts/Index.py
index ecb77be6..ede43388 100644
--- a/python/LbNightlyTools/Scripts/Index.py
+++ b/python/LbNightlyTools/Scripts/Index.py
@@ -164,14 +164,19 @@ class Script(BaseScript):
             ensureDirs([index_dir])
 
             glimpseindex = Popen(['glimpseindex', '-H', index_dir, '-F'],
-                                  cwd=proj_root,
-                                  stdin=PIPE,
-                                  stdout=glimpse_stdout)
+                                 cwd=proj_root,
+                                 stdin=PIPE,
+                                 stdout=glimpse_stdout)
             for f in filesToIndex(proj_root):
                 glimpseindex.stdin.write(f + '\n')
             glimpseindex.stdin.close()
             glimpseindex.wait()
 
+            self.log.debug('fixing indexes permissions')
+            for dirpath, _, filenames in os.walk(index_dir):
+                os.chmod(dirpath, 0755)
+                for filename in filenames:
+                    os.chmod(filename, 0644)
             self.log.info('packing indexes for %s...', proj)
             pack([proj.baseDir], join(self.artifacts_dir, self.packname(proj)),
                  cwd=indexes_dir, checksum='md5')
diff --git a/python/LbNightlyTools/Utils.py b/python/LbNightlyTools/Utils.py
index 41cdde24..15355aa8 100644
--- a/python/LbNightlyTools/Utils.py
+++ b/python/LbNightlyTools/Utils.py
@@ -596,7 +596,7 @@ class Dashboard(object):
         for r in self.db.iterview(viewname, batch=100, **opts):
             v = r[u'value']
             if returnAll:
-                yield(v)
+                yield v
             else:
                 yield (r[u'key'], v[u'slot'], v[u'build_id'])
 
-- 
GitLab