Uploaded image for project: 'ACS'
  1. ACS
  2. ACS-7

activateOffShoot type check is incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • None

      When trying to activate an offshoot from an interface inheriting from the ACS::OffShoot interface, we end up with the container claiming it's not an OffShoot. An example:

      2020-11-30T15:21:24.293 aragornContainer activateOffShoot - Not an OffShoot '<CALLBACKS_IMPL_MODULE.MyCallbackImpl.MyCallbackImpl object at 0x7efc80466470>'
      

      This is because the check is being done at Python level:

      elif not isinstance(os_corba_ref, OffShoot):
          ...
      

      The problem is that the servant implementations don't inherit from all the definitions in CORBA:

      Class: <class 'CALLBACKS_IMPL_MODULE.MyCallbackImpl.MyCallbackImpl'>
      Bases: (<class 'AsyncModule__POA.MyCallback'>,)
      

      So it would never have ACS__POA.OffShoot as base. The solution is to use CORBA's narrow instead, which correctly handled the IDL inheritance between interfaces:

      elif os_corba_ref._this()._narrow(OffShoot) is None:
          ...
      


              jaodev JAO Software Development (Inactive)
              Tomas.Staig Tomas Staig
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: