oracle / oracle/oci-cli

regression: oci ignores OCI_CLI_RC_FILE environment variable

Open
#668 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

SDK
Dominant language
Python
Stars
669
Forks
236
Avg merge
1m
Merged PRs (30d)
4

Description

The documentation for the OCI CLI states:

The default location and file name for the CLI-specific configuration file is ~/.oci/oci_cli_rc, but you can use the OCI_CLI_RC_FILE environment variable to modify where the CLI looks for a configuration file and its default values upon startup.

This is confirmed in CHANGELOG.rst for version 2.6.9

At the present time this fails as can be seen in the following example (attempting to use the FreeDesktop defined location):

❯ cat $OCI_CLI_RC_FILE
[DEFAULT]
user=ocid1.user.oc1.......
fingerprint=ba:03:ee:44:70:65:44:9c:ff:.....
key_file=/Users/bharrington/.local/share/oci/oci_api_key.pem
tenancy=ocid1.tenancy.oc1......
region=us-phoenix-1
pass_phrase="N/A"
❯ OCI_CLI_RC_FILE=/Users/bharrington/.config/oci oci os ns get
ERROR: Could not find config file at /Users/bharrington/.oci/config
Do you want to create a new config file? [Y/n]: 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documented OCI_CLI_RC_FILE behavior with the oci os ns get command and review the configuration details in CHANGELOG.rst. Trace the CLI's config-file resolution entry point and compare it with the documented environment-variable behavior; done means the specified file is used instead of ~/.oci/config, with coverage for the regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.