akamai / cli-cps

Provides a way to interact with the Akamai Certificate Provisioning System (CPS) via Open APIs. Provides various functionality such as viewing certificate details, generating audits, checking change statuses, and creating/modifying certificates.
Apache License 2.0
14 stars 16 forks source link

Removed default values #25

Closed partamonov closed 1 year ago

partamonov commented 4 years ago

Removed default values, which fixed https://github.com/akamai/cli-cps/issues/19

vreddhi commented 4 years 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.

partamonov commented 4 years ago

@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

partamonov commented 4 years ago

@vreddhi could you please review/comment?

vreddhi commented 4 years ago

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.