Giuseppe Lavagetto has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/391217 )

Change subject: Add some additional unit tests
......................................................................


Add some additional unit tests

Also, fix a couple of flake8 hiccups

Change-Id: I7de54963d5ea1597200e79a017f6893b7c781532
---
M puppet_compiler/prepare.py
M puppet_compiler/tests/test_controller.py
M puppet_compiler/threads.py
3 files changed, 6 insertions(+), 3 deletions(-)

Approvals:
  Giuseppe Lavagetto: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/puppet_compiler/prepare.py b/puppet_compiler/prepare.py
index af9dde0..f74ff1b 100644
--- a/puppet_compiler/prepare.py
+++ b/puppet_compiler/prepare.py
@@ -120,11 +120,11 @@
         pub = os.path.join(dirname, 'src')
         with open(hiera_file, 'r') as g, open('hiera.yaml', 'w') as f:
             for line in g:
-                l = line.replace(
+                data = line.replace(
                     '/etc/puppet/private', priv
                 ).replace(
                     '/etc/puppet', pub)
-                f.write(l)
+                f.write(data)
 
     @staticmethod
     def _create_puppetconf(dirname, realm):
diff --git a/puppet_compiler/tests/test_controller.py 
b/puppet_compiler/tests/test_controller.py
index d3b3526..8af9350 100644
--- a/puppet_compiler/tests/test_controller.py
+++ b/puppet_compiler/tests/test_controller.py
@@ -118,6 +118,9 @@
             c.pick_hosts('test.eqiad.wmnet,test.tools.eqiad.wmflabs')
 
         self.assertEqual(cm.exception.code, 2)
+        c = controller.Controller(None, 19, 224570, 'test.eqiad.wmflabs')
+        self.assertEqual(c.realm, 'labs')
+        self.assertEqual(c.m.realm, 'labs')
 
     def test_success(self):
         c = controller.Controller(None, 19, 224570, 'test.eqiad.wmnet')
diff --git a/puppet_compiler/threads.py b/puppet_compiler/threads.py
index f5d290d..3a451d2 100644
--- a/puppet_compiler/threads.py
+++ b/puppet_compiler/threads.py
@@ -74,7 +74,7 @@
         res = self._incoming_queue.get(True)
         try:
             callback(res)
-        except:
+        except Exception:
             _log.warn('post-exec callback failed.')
         self._incoming_queue.task_done()
 

-- 
To view, visit https://gerrit.wikimedia.org/r/391217
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7de54963d5ea1597200e79a017f6893b7c781532
Gerrit-PatchSet: 2
Gerrit-Project: operations/software/puppet-compiler
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to