Closed partamonov closed 1 year ago
Thank you for contributing. I see a potential problem here. What if the user does not define the environment variable. We probably need a way to prioritize the user argument --section, then environment variable, followed by a default section.
@vreddhi I agree that it may need a little bit more love and care, but I do not see any issues with section.
Condition 1: No AKAMAI_EDGERC_SECTION
environment variable set
With --section
argument
[root@53b47c42239e /]# akamai cps setup --section test
Edgerc section "test" not found
Expected result
Without --section
argument
[root@53b47c42239e /]# akamai cps setup
Edgerc section "cps" not found
Expected result
Condition 2: AKAMAI_EDGERC_SECTION
environment variable set
[root@53b47c42239e /]# export AKAMAI_EDGERC_SECTION=test
With --section
argument
[root@53b47c42239e /]# akamai cps setup --section testENV
Edgerc section "testENV" not found
Expected result
Without --section
argument
[root@53b47c42239e /]# akamai cps setup
Edgerc section "test" not found
Expected result
If you can give scenario I missed, I would me more then happy to address
@vreddhi could you please review/comment?
When i set the environment variable AKAMAI_EDGERC_SECTION
to some value, the print statement is unable to find args.section
to display correct output. Here is what i am seeing:
Trying to get contract details from [] section of ~/.edgerc file. We will need a way to set args.section to value of AKAMAI_EDGERC_SECTION
if the env is defined and user does not provide --section
argument.
Removed default values, which fixed https://github.com/akamai/cli-cps/issues/19