[openlmi-tools] fix compulsory call order of LMIIndicationListener methods

Peter Hatina phatina at fedoraproject.org
Wed Dec 4 11:04:57 UTC 2013


commit 1d2057ef85ca5329f4aaef8a8abd23be319ed2eb
Author: Peter Hatina <phatina at redhat.com>
Date:   Wed Dec 4 12:03:50 2013 +0100

    fix compulsory call order of LMIIndicationListener methods

 ...ols-08-fix-compulsory-call-order-listener.patch |   40 ++++++++++++++++++++
 openlmi-tools.spec                                 |    7 +++-
 2 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/openlmi-tools-08-fix-compulsory-call-order-listener.patch b/openlmi-tools-08-fix-compulsory-call-order-listener.patch
new file mode 100644
index 0000000..21bd3c5
--- /dev/null
+++ b/openlmi-tools-08-fix-compulsory-call-order-listener.patch
@@ -0,0 +1,40 @@
+diff --git a/cli/lmi/shell/LMIIndicationListener.py b/cli/lmi/shell/LMIIndicationListener.py
+index 1ec2f21..cc48b9b 100644
+--- a/cli/lmi/shell/LMIIndicationListener.py
++++ b/cli/lmi/shell/LMIIndicationListener.py
+@@ -115,6 +115,9 @@ class LMIIndicationListener(object):
+         self._certfile = certfile
+         self._keyfile = keyfile
+ 
++        self._server = None
++        self._server_thread = None
++
+     def __create_handler_name(self, handler_name_pattern):
+         """
+         Returns unique handler name by replacing "**X**" characters for random characters
+@@ -163,8 +166,12 @@ class LMIIndicationListener(object):
+         """
+         Stops the indication listener.
+         """
+-        self._server.shutdown()
+-        self._server_thread.join()
++        if self._server:
++            self._server.shutdown()
++        if self._server_thread:
++            self._server_thread.join()
++        self._server = None
++        self._server_thread = None
+ 
+     @property
+     def is_alive(self):
+@@ -172,7 +179,9 @@ class LMIIndicationListener(object):
+         :returns: flag indicating, if the indication listener is running
+         :rtype: bool
+         """
+-        return self._server_thread.is_alive()
++        if self._server_thread:
++            return self._server_thread.is_alive()
++        return False
+ 
+     @property
+     def hostname(self):
diff --git a/openlmi-tools.spec b/openlmi-tools.spec
index 5c120be..79d5423 100644
--- a/openlmi-tools.spec
+++ b/openlmi-tools.spec
@@ -1,6 +1,6 @@
 Name:           openlmi-tools
 Version:        0.9
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        Set of CLI tools for Openlmi providers
 
 License:        GPLv2+
@@ -13,6 +13,7 @@ Patch3:         openlmi-tools-04-fix-passing-method-params.patch
 Patch4:         openlmi-tools-05-fix-log-messages-connect.patch
 Patch5:         openlmi-tools-06-fix-unify-lmishell-naming.patch
 Patch6:         openlmi-tools-07-fix-interactive-connect.patch
+Patch7:         openlmi-tools-08-fix-compulsory-call-order-listener.patch
 BuildArch:      noarch
 
 BuildRequires:  automake
@@ -47,6 +48,7 @@ Summary:        Documentation for %{name}
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 %build
 pushd cli
@@ -98,6 +100,9 @@ install -m 644 cli/completion/_lmishell $zsh_comp_dir
 %{_docdir}/%{name}-%{version}/html
 
 %changelog
+* Wed Dec  4 2013 Peter Hatina <phatina at redhat.com> - 0.9-9
+- fix compulsory call order of LMIIndicationListener methods
+
 * Tue Dec  3 2013 Peter Hatina <phatina at redhat.com> - 0.9-8
 - fix interactive connect when run with -i
 


More information about the scm-commits mailing list