Skip to content

Fix #589 Create elements in Macroserver with multiple pools

ovallcorba requested to merge Issue589-define-default-pool into develop

The merge request addresses the following issue: #589 (closed)

  1. A new method in the macroserver has been created called get_default_pool. It provides the pool defined by the environmental variable DefaultPool, if available. If the env var is not set, if only one pool is available it will return it, otherwise it will raise an exception.

  2. At the ParamDecoder level we added a logic to check for multiple Pools and act in case there is an ambiguity (an Element can be added in more than one pool). Now the getObj method:

    • Checks if the Element is in any of the MacroServer defined Pools
    • If not in any Pool -> raise Execption (with info msg)
    • If only in one Pool -> use that Pool
    • If in more than one pool:
      • Get the DefaultPool using macroserver.get_default_pool (and raises exception if not set)
      • If element is in DefaultPool use it, otherwise raise exception (with info msg)

All macros in Expert takes an object (Controller, Element, PoolElement, ...) as Parameter, so they go through the ParamDecoder logic (point 2) except for addCtrlLib that receives a String as parameter and in this case it is calling directly macroserver.get_default_pool

Also:

  • The documentation file environment_variable_catalog.rst has been updated accordingly.
  • The get_pool(name) method in Macroserver has been improved and now it can check the given pool_name in the key and value of the _pools dict.
  • The output in spock of all macros in Expert has been improved (added when there was no output) showing the operation done and to which pool.

Thank you and best regards!

Edited by ovallcorba

Merge request reports