Module: check_mk
Branch: master
Commit: 87ba26e0ca0a2d699bcdc4cc4c46183b2d289422
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=87ba26e0ca0a2d…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Mon Apr 15 14:14:58 2019 +0200
agent_azure: use Lock context
Change-Id: Ie8c2f076c626f45814c325a5d937b282a05dba5b
---
agents/special/agent_azure | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/agents/special/agent_azure b/agents/special/agent_azure
index a2f97ed..0a1d2c9 100755
--- a/agents/special/agent_azure
+++ b/agents/special/agent_azure
@@ -372,10 +372,9 @@ class Section(object):
def write(self):
if not self._cont:
return
- self.LOCK.acquire()
- sys.stdout.writelines(self._head + self._cont + self._foot)
- sys.stdout.flush()
- self.LOCK.release()
+ with self.LOCK:
+ sys.stdout.writelines(self._head + self._cont + self._foot)
+ sys.stdout.flush()
class AzureSection(Section):