ucc icon indicating copy to clipboard operation
ucc copied to clipboard

UTIL: cfg parser respect inherited vars

Open vspetrov opened this issue 2 years ago • 5 comments

What

Fixes config file parsing with respect to inherited variables

Why ?

When the variable in the config table is inherited from another parent table (e.g., TLS var in CLs is defined in parent ucc_cl_base_config), and user sets the top variable in the env it gets overwritten by the file configuration. For example, if there is cfg file with entry: UCC_CL_BASIC_TLS=^sharp

and user runs app with: UCC_TLS=ucp , then the value of CL_BASIC_TLS would still be "^sharp", i.e. all except sharp - not what user expects (which is "ucp" only).

How ?

When applying value from cfg file database need to check if there is a parent variable setting in the environment and then skip it in that case.

vspetrov avatar Jun 22 '22 12:06 vspetrov

if UCC_CL_BASIC_TLS is not inthe environment, then is it the same as UCS_TLS

bureddy avatar Jul 19 '22 18:07 bureddy

if UCC_CL_BASIC_TLS is not inthe environment, then is it the same as UCS_TLS

@bureddy i don't understand. could you plz elaborate?

vspetrov avatar Jul 19 '22 20:07 vspetrov

if UCC_CL_BASIC_TLS is not inthe environment, then is it the same as UCC_TLS

@bureddy i don't understand. could you plz elaborate?

I mean if the user sets UCC_TL but not UCC_CL_BASIC_TLS. does it alway inherit from UCC_TLS ?

bureddy avatar Jul 19 '22 20:07 bureddy

if UCC_CL_BASIC_TLS is not inthe environment, then is it the same as UCC_TLS

@bureddy i don't understand. could you plz elaborate?

I mean if the user sets UCC_TL but not UCC_CL_BASIC_TLS. does it alway inherit from UCC_TLS ?

This was the behavior before file cfg, which broke it. UCC_TLS is the highest var in the hierarchy, all CLs vars inherit from it. W/o config file, we can set UCC_TLS=ucp and this will guarantee all CLs only have ucp.

Say, i want to disable TL/SHM. It is used in both CLs hier and basic. I could just set UCC_TLS=^shm. But currently due to bug in cfg file, it will not work.

vspetrov avatar Jul 19 '22 20:07 vspetrov

@vspetrov Please add a FAQ entry to capture this example.

manjugv avatar Jul 20 '22 17:07 manjugv