Yes Hung points to something that can be important. Using no flags is typically not a good idea unless the python script is only executed when installing some module and creating some imm objects before the OI has ever existed. Or if no OI will ever exist for these objecs. This because it will allow the CCB to go through un-validated by the OI later even when that OI is only temporarily disconnected. A temporary disconnect is inevitable during failover or switchover so if a python "script" is executing repeatedly and not just as part of initial installation of something, then you instead want to set:
SA_IMM_CCB_REGISTERED_OI | SA_IMM_CCB_ALLOW_NULL_OI See osaf/services/saf/immsv/README /AndersBj From: Hung Nguyen [mailto:[email protected]] Sent: den 15 juli 2015 06:51 To: Johan Mårtensson O; Hans Nordebäck; Anders Björnerstedt; [email protected] Cc: [email protected] Subject: Re: [PATCH 1 of 1] pyosaf: Add parameter to override SA_IMM_CCB_REGISTERED flag in ccb.py [#1417] 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
