From fda8fa77ab3f84d1c173280eca3f409e1e5b8881 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Thu, 2 Jul 2015 15:57:34 +0200 Subject: [PATCH 1/2] Fix pyflakes error: use 'msg' variable Error was: local variable 'msg' is assigned to but never used --- lib/ansible/plugins/callback/default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/callback/default.py b/lib/ansible/plugins/callback/default.py index 8fbb0654bef..b6e56f99fda 100644 --- a/lib/ansible/plugins/callback/default.py +++ b/lib/ansible/plugins/callback/default.py @@ -108,4 +108,4 @@ class CallbackModule(CallbackBase): else: msg = "PLAY [%s]" % name - self._display.banner(name) + self._display.banner(msg) From 8c392a94b718381d7b486c97ea9585919e48c638 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Thu, 2 Jul 2015 16:11:56 +0200 Subject: [PATCH 2/2] Play.get_name: remove prefix, return name only --- lib/ansible/playbook/play.py | 2 +- test/units/playbook/test_play.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index ecaeac23622..e8477c4a408 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -95,7 +95,7 @@ class Play(Base, Taggable, Become): def get_name(self): ''' return the name of the Play ''' - return "PLAY: %s" % self._attributes.get('name') + return self._attributes.get('name') @staticmethod def load(data, variable_manager=None, loader=None): diff --git a/test/units/playbook/test_play.py b/test/units/playbook/test_play.py index 561da36272b..0dbac227bd4 100644 --- a/test/units/playbook/test_play.py +++ b/test/units/playbook/test_play.py @@ -39,7 +39,7 @@ class TestPlay(unittest.TestCase): def test_empty_play(self): p = Play.load(dict()) - self.assertEqual(str(p), "PLAY: ") + self.assertEqual(str(p), '') def test_basic_play(self): p = Play.load(dict(