Hi Johan,

Tested the patch.
Ack from me.

Do you consider adding support for SA_IMM_CCB_ALLOW_NULL_OI also?

Best Regards,

Hung Nguyen
DEK Technologies




------------------------------------------------------------------------

*From:* Johan Mårtensson O
*Sent:* Tuesday, July 14, 2015 3:56PM
*To:* Hans Nordeback, Anders Bjornerstedt, Mathivanan Naickan, Hung Nguyen
*Cc:* Opensaf-devel
*Subject:* [PATCH 1 of 1] pyosaf: Add parameter to override 
SA_IMM_CCB_REGISTERED flag in ccb.py [#1417]

  python/pyosaf/utils/immom/ccb.py |  10 +++++++---
  1 files changed, 7 insertions(+), 3 deletions(-)


Add a parameter to allow overriding the default behavior for the Ccb class in 
ccb.py. The default is to require a registered OI using the 
SA_IMM_CCB_REGISTERED flag but now a CCB can be created that doesn't require 
this, using:

ccb = Ccb(require_registered_oi=False)

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, require_registered_oi=True):
          self.owner_handle = saImmOm.SaImmAdminOwnerHandleT()
  
          owner_name = saImmOm.SaImmAdminOwnerNameT("DummyName")
@@ -94,8 +94,12 @@ class Ccb(object):
  
          self.ccb_handle = saImmOm.SaImmCcbHandleT()
  
-        ccb_flags = saImmOm.SaImmCcbFlagsT(
-            saImm.saImm.SA_IMM_CCB_REGISTERED_OI)
+        if require_registered_oi:
+            ccb_flags = saImmOm.SaImmCcbFlagsT(
+                saImm.saImm.SA_IMM_CCB_REGISTERED_OI)
+        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
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to