Ack, code review only,  yes it should be 
SaImmAdminOperationParamsT_2./Regards HansN
On 10/20/2014 01:25 PM, Hans Feldt wrote:
>
> On 10/20/2014 10:40 AM, Hans Feldt wrote:
>>   python/pyosaf/saAis.py   |  4 ++--
>>   python/pyosaf/saImmOm.py |  2 +-
>>   2 files changed, 3 insertions(+), 3 deletions(-)
>>
>>
>> exception when using saImmOmAdminOperationInvoke_2:
>>   ctypes.ArgumentError: argument 5: <type 'exceptions.TypeError'="">: 
>> expected LP_LP_SaImmAdminOperationParamsT instance instead of 
>> c_void_p_Array_1
>>
>> Problem is the function marshalNullArray cannot handle an empty list.
>>
>> Add type argument to marshalNullArray and use it to create array type 
>> properly.
>>
>> diff --git a/python/pyosaf/saAis.py b/python/pyosaf/saAis.py
>> --- a/python/pyosaf/saAis.py
>> +++ b/python/pyosaf/saAis.py
>> @@ -184,11 +184,11 @@ def BYREF(data):
>>       """
>>       return None if data == None else byref(data)
>>   -def marshalNullArray(plist):
>> +def marshalNullArray(plist, type_name=c_void_p):
>>       """Convert Python list to null-terminated c array.
>>       """
>>       if not plist:
>> -        return None if plist == None else (c_void_p*1)()
>> +        return None if plist == None else (type_name*1)()
>>       ctype = plist[0].__class__
>>       if ctype is SaStringT:
>>           return marshalSaStringTArray(plist)
>> diff --git a/python/pyosaf/saImmOm.py b/python/pyosaf/saImmOm.py
>> --- a/python/pyosaf/saImmOm.py
>> +++ b/python/pyosaf/saImmOm.py
>> @@ -619,7 +619,7 @@ def saImmOmAdminOperationInvoke_2(ownerH
>>           SaAisErrorT
>>         """
>> -    c_params = marshalNullArray(params)
>> +    c_params = marshalNullArray(params, 
>> POINTER(SaImmAdminOperationParamsT))
> actually it should be SaImmAdminOperationParamsT_2 in this function
>> omdll.saImmOmAdminOperationInvoke_2.argtypes = [SaImmAdminOwnerHandleT,
>>                           POINTER(SaNameT),
>>                           SaImmContinuationIdT,
>>
>> ------------------------------------------------------------------------------
>>  
>>
>> Comprehensive Server Monitoring with Site24x7.
>> Monitor 10 servers for $9/Month.
>> Get alerted through email, SMS, voice calls or mobile push 
>> notifications.
>> Take corrective actions from your mobile device.
>> http://p.sf.net/sfu/Zoho
>> _______________________________________________
>> Opensaf-devel mailing list
>> Opensaf-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
>>
>>
>


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to