Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Expand filepaths passed on the CLI relative to cwd #1791

Merged
merged 1 commit into from
May 11, 2020

Conversation

lucywyman
Copy link
Contributor

@lucywyman lucywyman commented May 6, 2020

As part of the #1364 work to
standardize how we expand configured paths we expand all paths
configured in files relative to the project directory, and stated that
all paths set on the CLI would be expanded relative to the directory
Bolt was run from. However, only some CLI paths (inventoryfile and
puppetfile) were expanded this way, while others (hiera-config and
private-key) were expanded relative to the project
directory. This standardizes paths passed on the CLI to be expanded
relative to the cwd. This is accomplished by expanding the path in our
CLI option handler, so that the config object only sees the path as
absolute and does not try to expand it relative to the project.

!bug

  • Expand filepaths passed on the CLI relative to the current working directory
    Config options hiera-config and private-key are now expanded relative
    to the directory Bolt was run from when specified on the CLI, inline
    with other CLI options.

@lucywyman lucywyman marked this pull request as ready for review May 6, 2020 18:02
@lucywyman lucywyman requested a review from a team as a code owner May 6, 2020 18:02
lib/bolt/bolt_option_parser.rb Outdated Show resolved Hide resolved
lib/bolt/bolt_option_parser.rb Outdated Show resolved Hide resolved
@nicklewis nicklewis self-requested a review May 6, 2020 18:41
@puppetcla
Copy link

CLA signed by all contributors.

@nicklewis
Copy link
Contributor

There's a test failing now. It looks like the most recent pushed removed an expand_path in the test that was still necessary

As part of the [puppetlabs#1364](puppetlabs#1364) work to
standardize how we expand configured paths we expand all paths
configured in files relative to the project directory, and stated that
all paths set on the CLI would be expanded relative to the directory
Bolt was run from. However, only some CLI paths (inventoryfile and
puppetfile) were expanded this way, while others (hiera-config and
private-key) were expanded relative to the project
directory. This standardizes paths passed on the CLI to be expanded
relative to the cwd. This is accomplished by expanding the path in our
CLI option handler, so that the config object only sees the path as
absolute and does not try to expand it relative to the project.

!bug

* **Expand filepaths passed on the CLI relative to the current working directory**
  Config options hiera-config and private-key are now expanded relative
  to the directory Bolt was run from when specified on the CLI, inline
  with other CLI options.
@nicklewis nicklewis merged commit b78b595 into puppetlabs:master May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants