[cura-tools] master: bump release version to 0.10.1 (5ceb236)
by phatina@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
>---------------------------------------------------------------
commit 5ceb2363f92d007fcc907cde2d2f738c1fd6fce1
Author: Peter Hatina <phatina(a)redhat.com>
Date: Mon Sep 1 12:39:08 2014 +0200
bump release version to 0.10.1
>---------------------------------------------------------------
cli/lmi/shell/LMIShellVersion.py | 2 +-
cli/man/lmi.1 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cli/lmi/shell/LMIShellVersion.py b/cli/lmi/shell/LMIShellVersion.py
index 6df2b4e..d32920a 100644
--- a/cli/lmi/shell/LMIShellVersion.py
+++ b/cli/lmi/shell/LMIShellVersion.py
@@ -13,4 +13,4 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
-__version__ = "0.9.2"
+__version__ = "0.10.1"
diff --git a/cli/man/lmi.1 b/cli/man/lmi.1
index fa9e616..f803377 100644
--- a/cli/man/lmi.1
+++ b/cli/man/lmi.1
@@ -1,4 +1,4 @@
-.TH lmi 1 "June 2014" "openlmi-scripts 1.0.0" "User Commands"
+.TH lmi 1 "September 2014" "openlmi-scripts 1.0.0" "User Commands"
.SH NAME
lmi \- meta-command for managing systems with OpenLMI providers
9 years, 8 months
[cura-tools] master: always use CIMListener prefix for indication path (bafa25f)
by phatina@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
>---------------------------------------------------------------
commit bafa25f668bfcedef7714550d45df87aa05afddc
Author: Peter Hatina <phatina(a)redhat.com>
Date: Mon Sep 1 12:16:56 2014 +0200
always use CIMListener prefix for indication path
>---------------------------------------------------------------
cli/lmi/shell/LMIConnection.py | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/cli/lmi/shell/LMIConnection.py b/cli/lmi/shell/LMIConnection.py
index 97bceaa..197cc12 100644
--- a/cli/lmi/shell/LMIConnection.py
+++ b/cli/lmi/shell/LMIConnection.py
@@ -486,9 +486,6 @@ class LMIConnection(object):
if cim_handler_provided:
cim_handler = kwargs["Handler"]._cim_instance
else:
- indication_prefix = ""
- if HAVE_LMIWBEM:
- indication_prefix = "CIMListener/"
cim_handler_props = {
"CreationClassName": kwargs.get(
"HandlerCreationClassName",
@@ -497,9 +494,8 @@ class LMIConnection(object):
"HandlerSystemCreationClassName",
"CIM_ComputerSystem"),
"SystemName": self._client.uri,
- "Destination": "%s/%s%s" % (
+ "Destination": "%s/CIMListener/%s" % (
kwargs["Destination"],
- indication_prefix,
kwargs["Name"]),
"Name": kwargs["Name"] + "-handler"
}
9 years, 8 months
[cura-tools] master: fix compat.CIMIndicationListener indication delivery (39d1348)
by phatina@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
>---------------------------------------------------------------
commit 39d1348ba4f762e57c72ce02adcd1a59f12d3bd3
Author: Peter Hatina <phatina(a)redhat.com>
Date: Mon Sep 1 12:16:32 2014 +0200
fix compat.CIMIndicationListener indication delivery
When using PyWBEM, no indications are being passed to callbacks due to wrong prefix present in path.
>---------------------------------------------------------------
cli/lmi/shell/LMIMethod.py | 7 ++-----
cli/lmi/shell/compat/CIMIndicationListener.py | 21 +++++++++++++++++----
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/cli/lmi/shell/LMIMethod.py b/cli/lmi/shell/LMIMethod.py
index b30d265..b6f1775 100644
--- a/cli/lmi/shell/LMIMethod.py
+++ b/cli/lmi/shell/LMIMethod.py
@@ -393,14 +393,11 @@ class LMIMethod(LMIWrapperBaseObject):
s.close()
# Create handler object
- indication_prefix = ""
- if HAVE_LMIWBEM:
- indication_prefix = "CIMListener/"
cim_handler_props = {
"Name": indication_name,
- "Destination": "%s://%s:%d/%s%s" % (
+ "Destination": "%s://%s:%d/CIMListener/%s" % (
"https" if listener.uses_ssl else "http",
- destination, listener.port, indication_prefix, indication_name),
+ destination, listener.port, indication_name),
}
cim_handler, _, _ = self._conn.client.create_instance(
"CIM_IndicationHandlerCIMXML",
diff --git a/cli/lmi/shell/compat/CIMIndicationListener.py b/cli/lmi/shell/compat/CIMIndicationListener.py
index 6b8a2d1..d2d939e 100644
--- a/cli/lmi/shell/compat/CIMIndicationListener.py
+++ b/cli/lmi/shell/compat/CIMIndicationListener.py
@@ -53,6 +53,8 @@ class CIMIndicationHandler(ThreadingMixIn, BaseHTTPRequestHandler):
listener is designed as concurrent server to properly handle each incoming
indication.
"""
+ CIMLISTENER_PREFIX = "/CIMListener"
+
def do_POST(self):
"""
Overridden method, which is called, when a indication is received. It
@@ -98,12 +100,23 @@ class CIMIndicationHandler(ThreadingMixIn, BaseHTTPRequestHandler):
ind_dict = export_methods.values()[0]
if "NewIndication" in ind_dict:
ind = ind_dict["NewIndication"]
+
path = self.path
- if path.startswith("CIMListener/"):
- # We got an indication with lmiwbem CIMListener prefix. We are
- # using pywbem now so it's necessary to strip the prefix.
- path = path[12:]
+ cimlistener_ind = path.find(self.CIMLISTENER_PREFIX)
+ if cimlistener_ind != -1:
+ # We got an indication with lmiwbem's CIMListener substring
+ # present. We are using pywbem now, so it's necessary to strip the
+ # prefix also with the substring (from the beginning). We try to
+ # mimic Pegasus::CIMListener behavior here.
+ path = path[cimlistener_ind + len(self.CIMLISTENER_PREFIX):]
+
+ if path[0] == '/':
+ # Path of the received indication may be prefixed by additional
+ # slash. Drop it then.
+ path = path[1:]
+
if path in self.server._handlers:
+ # We found the indication handler. Execute the callback.
cb = self.server._handlers[path]
cb.callback(ind, *cb.args, **cb.kwargs)
9 years, 8 months