python/pyosaf/saImm.py                |  1 +
 python/pyosaf/utils/immom/__init__.py |  2 +-
 python/pyosaf/utils/immom/ccb.py      |  9 ++++++---
 3 files changed, 8 insertions(+), 4 deletions(-)


Add a flags parameter that lets the user override the default flags for the Ccb 
flags. The default SA_IMM_CCB_REGISTERED_OI is still kept.

Also step the imm om version to A.2.15 to enable the SA_IMM_CCB_ALLOW_NULL_OI 
flag and add it in saImm.py.

Verify like this:
 - Kill an OI
 - Delete one of the OI's instances:

from pyosaf.utils.immom.ccb import Ccb

cb = Ccb(flags=None)
ccb.delete(<instance-dn>)
ccb.apply()

diff --git a/python/pyosaf/saImm.py b/python/pyosaf/saImm.py
--- a/python/pyosaf/saImm.py
+++ b/python/pyosaf/saImm.py
@@ -152,6 +152,7 @@ class SaImmSearchParametersT_2(Union):
        _fields_ = [('searchOneAttr', SaImmSearchOneAttrT_2)]
 
 saImm.SA_IMM_CCB_REGISTERED_OI = 0x00000001
+saImm.SA_IMM_CCB_ALLOW_NULL_OI = 0x0000000000000100
 
 SaImmCcbFlagsT = SaUint64T
 
diff --git a/python/pyosaf/utils/immom/__init__.py 
b/python/pyosaf/utils/immom/__init__.py
--- a/python/pyosaf/utils/immom/__init__.py
+++ b/python/pyosaf/utils/immom/__init__.py
@@ -42,7 +42,7 @@ TRYAGAIN_CNT = 60
 
 def _initialize():
     ''' saImmOmInitialize with TRYAGAIN handling '''
-    version = SaVersionT('A', 2, 1)
+    version = SaVersionT('A', 2, 15)
     one_sec_sleeps = 0
     err = saImmOm.saImmOmInitialize(HANDLE, None, version)
     while err == eSaAisErrorT.SA_AIS_ERR_TRY_AGAIN:
diff --git a/python/pyosaf/utils/immom/ccb.py b/python/pyosaf/utils/immom/ccb.py
--- a/python/pyosaf/utils/immom/ccb.py
+++ b/python/pyosaf/utils/immom/ccb.py
@@ -73,7 +73,7 @@ def marshal_c_array(value_type, value_li
     return c_array
 
 class Ccb(object):
-    def __init__(self):
+    def __init__(self, flags=[saImm.saImm.SA_IMM_CCB_REGISTERED_OI]):
         self.owner_handle = saImmOm.SaImmAdminOwnerHandleT()
 
         owner_name = saImmOm.SaImmAdminOwnerNameT("DummyName")
@@ -94,8 +94,11 @@ class Ccb(object):
 
         self.ccb_handle = saImmOm.SaImmCcbHandleT()
 
-        ccb_flags = saImmOm.SaImmCcbFlagsT(
-            saImm.saImm.SA_IMM_CCB_REGISTERED_OI)
+        if flags:
+            ccb_flags = saImmOm.SaImmCcbFlagsT(reduce(lambda a, b: a|b, flags))
+        else:
+            ccb_flags = saImmOm.SaImmCcbFlagsT(0)
+
         one_sec_sleeps = 0
         err = saImmOm.saImmOmCcbInitialize(self.owner_handle, ccb_flags,
                                            self.ccb_handle)

------------------------------------------------------------------------------
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
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to