Ack from me. Not tested. /AndersBj
-----Original Message----- From: Johan Mårtensson O Sent: den 9 juli 2015 16:52 To: Hans Nordebäck; Anders Björnerstedt; [email protected] Cc: [email protected] Subject: [PATCH 1 of 1] pyosaf: Fix broken marshalling of the attribute list in saImmOmSearchInitialize_2 in saImmOm.py [#1408] python/pyosaf/saImmOm.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) Fixes the marshalling of the attribute list in saImmOmSearchInitialize_2 in saImmOm.py. The following code can be copy-pasted into the Python shell to verify the fix: from pyosaf.saImm import SaImmSearchParametersT_2, eSaImmValueTypeT, eSaImmScopeT, SaImmAttrNameT from ctypes import cast, pointer, c_void_p, c_char_p from pyosaf import saImm, saImmOm from pyosaf.utils import immom name = c_char_p("SampleClass") search_param = SaImmSearchParametersT_2() search_param.searchOneAttr.attrName = "SaImmAttrClassName" search_param.searchOneAttr.attrValueType = eSaImmValueTypeT.SA_IMM_ATTR_SASTRINGT search_param.searchOneAttr.attrValue = cast(pointer(name), c_void_p) scope = eSaImmScopeT.SA_IMM_SUBTREE search_options = saImm.saImm.SA_IMM_SEARCH_ONE_ATTR | saImm.saImm.SA_IMM_SEARCH_GET_SOME_ATTR attribute_names = None search_handle = saImmOm.SaImmSearchHandleT() attribute_names = [SaImmAttrNameT("attribute1")] saImmOm.saImmOmSearchInitialize_2(immom.HANDLE, None, scope, search_options, search_param, attribute_names, search_handle) diff --git a/python/pyosaf/saImmOm.py b/python/pyosaf/saImmOm.py --- a/python/pyosaf/saImmOm.py +++ b/python/pyosaf/saImmOm.py @@ -262,6 +262,7 @@ def saImmOmSearchInitialize_2(immHandle, SaAisErrorT """ + c_attributeNames = marshalNullArray(attributeNames) omdll.saImmOmSearchInitialize_2.argtypes = [SaImmHandleT, POINTER(SaNameT), @@ -278,7 +279,7 @@ def saImmOmSearchInitialize_2(immHandle, scope, searchOptions, BYREF(searchParams), - BYREF(attributeNames), + c_attributeNames, BYREF(searchHandle)) ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
