From 314ae7bdb015cc6d9ac5e52fc6cb8d6f95b6baa5 Mon Sep 17 00:00:00 2001 From: adrianiurca Date: Mon, 17 Aug 2020 21:25:45 +0300 Subject: [PATCH] set a default value if custom facts fails --- .github/workflows/release.yml | 4 ++-- .github/workflows/weekly.yml | 4 ++-- .repo/config | 8 ++++---- CHANGELOG.md | 3 +-- CONTRIBUTING.md | 2 +- HISTORY.md | 3 +-- README.md | 6 +++--- manifests/params.pp | 6 +++++- metadata.json | 4 ++-- 9 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e112d8f..423c3759 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v1 - name: Litmus Parallel - uses: puppetlabs/action-litmus_parallel@master + uses: puppetlabs/action-litmus_parallel@main with: platform: ${{ matrix.platform }} agent_family: ${{ matrix.agent_family }} @@ -49,7 +49,7 @@ jobs: - uses: actions/checkout@v1 - name: Spec Tests - uses: puppetlabs/action-litmus_spec@master + uses: puppetlabs/action-litmus_spec@main with: puppet_gem_versionm: ${{ matrix.puppet_gem_version }} check: ${{ matrix.check }} diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 9f667dab..da2ca7db 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Litmus Parallel - uses: puppetlabs/action-litmus_parallel@master + uses: puppetlabs/action-litmus_parallel@main with: platform: ${{ matrix.platform }} agent_family: ${{ matrix.agent_family }} @@ -40,7 +40,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Spec Tests - uses: puppetlabs/action-litmus_spec@master + uses: puppetlabs/action-litmus_spec@main with: puppet_gem_version: ${{ matrix.puppet_gem_version }} check: ${{ matrix.check }} diff --git a/.repo/config b/.repo/config index 45e2878a..98bc07e1 100644 --- a/.repo/config +++ b/.repo/config @@ -17,7 +17,7 @@ fetch = +refs/heads/*:refs/remotes/jumanjiman/* [alias] # maintainer should use these when reviewing PRs authors = shortlog -sn -behind = !git log ..upstream/master --oneline -ahead = !git log upstream/master.. --oneline -unmerged = !git cherry upstream/master -files = !git diff --name-only upstream/master.. +behind = !git log ..upstream/main --oneline +ahead = !git log upstream/main.. --oneline +unmerged = !git cherry upstream/main +files = !git diff --name-only upstream/main.. diff --git a/CHANGELOG.md b/CHANGELOG.md index d5c604d4..9f0670a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -302,7 +302,7 @@ The puppetlabs-chocolatey module replaces the community chocolatey-chocolatey mo ### Fixed -- Blocking: Linux masters throw error if the module is present [#54](https://github.com/chocolatey/puppet-chocolatey/issues/54) +- Blocking: Linux servers throw error if the module is present [#54](https://github.com/chocolatey/puppet-chocolatey/issues/54) ## [0.5.0] - 2015-03-30 @@ -324,7 +324,6 @@ The puppetlabs-chocolatey module replaces the community chocolatey-chocolatey mo ## [0.2] -[Unreleased]: https://github.com/puppetlabs/puppetlabs-chocolatey/compare/3.3.0...master [3.3.0]: https://github.com/puppetlabs/puppetlabs-chocolatey/compare/3.2.0...3.3.0 [3.2.0]: https://github.com/puppetlabs/puppetlabs-chocolatey/compare/3.1.1...3.2.0 [3.1.1]: https://github.com/puppetlabs/puppetlabs-chocolatey/compare/3.1.0...3.1.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a9fb3a5..9c171f99 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,7 +108,7 @@ process as easy as possible. To submit your changes via a GitHub pull request, we _highly_ recommend that you have them on a topic branch, instead of - directly on "master". + directly on "main". It makes things much easier to keep track of, especially if you decide to work on another thing before your first change is merged in. diff --git a/HISTORY.md b/HISTORY.md index d1c0039e..f3eb16bf 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -252,7 +252,7 @@ The puppetlabs-chocolatey module replaces the community chocolatey-chocolatey mo ### Fixed -- Blocking: Linux masters throw error if the module is present [#54](https://github.com/chocolatey/puppet-chocolatey/issues/54) +- Blocking: Linux servers throw error if the module is present [#54](https://github.com/chocolatey/puppet-chocolatey/issues/54) ## [0.5.0] - 2015-03-30 @@ -274,7 +274,6 @@ The puppetlabs-chocolatey module replaces the community chocolatey-chocolatey mo ## [0.2] -[Unreleased]: https://github.com/puppetlabs/puppetlabs-chocolatey/compare/3.3.0...master [3.3.0]: https://github.com/puppetlabs/puppetlabs-chocolatey/compare/3.2.0...3.3.0 [3.2.0]: https://github.com/puppetlabs/puppetlabs-chocolatey/compare/3.1.1...3.2.0 [3.1.1]: https://github.com/puppetlabs/puppetlabs-chocolatey/compare/3.1.0...3.1.1 diff --git a/README.md b/README.md index cd919746..bdc0c514 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # chocolatey -[![Build Status](https://api.travis-ci.org/puppetlabs/puppetlabs-chocolatey.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-chocolatey) [![Build status](https://ci.appveyor.com/api/projects/status/uosorvcyhnayv70m/branch/master?svg=true)](https://ci.appveyor.com/project/puppetlabs/puppetlabs-chocolatey/branch/master) +[![Build Status](https://api.travis-ci.org/puppetlabs/puppetlabs-chocolatey.png?branch=)](https://travis-ci.org/puppetlabs/puppetlabs-chocolatey) [![Build status](https://ci.appveyor.com/api/projects/status/uosorvcyhnayv70m/branch/main?svg=true)](https://ci.appveyor.com/project/puppetlabs/puppetlabs-chocolatey/branch/main) ### Chocolatey for Business Now Available! @@ -534,7 +534,7 @@ might want to do this in a default: ## Reference -For information on classes and types, see [REFERENCE.md](https://github.com/puppetlabs/puppetlabs-chocolatey/blob/master/REFERENCE.md). For information on facts, see below. +For information on classes and types, see [REFERENCE.md](https://github.com/puppetlabs/puppetlabs-chocolatey/blob/main/REFERENCE.md). For information on facts, see below. ### Facts @@ -543,7 +543,7 @@ For information on classes and types, see [REFERENCE.md](https://github.com/pupp ## Limitations -* **The module is only suppported on Windows.** For an extensive list of supported operating systems, see [metadata.json](https://github.com/puppetlabs/puppetlabs-chocolatey/blob/master/metadata.json) +* **The module is only suppported on Windows.** For an extensive list of supported operating systems, see [metadata.json](https://github.com/puppetlabs/puppetlabs-chocolatey/blob/main/metadata.json) * If you override an existing install location of Chocolatey using `choco_install_location =>` in the Chocolatey class, it does not bring any of the existing packages with it. You will need to handle that through some other means. * Overriding the install location will also not allow Chocolatey to be configured or install packages on the same run that it is installed on. See [`choco_install_location`](#choco_install_location) for details. diff --git a/manifests/params.pp b/manifests/params.pp index 2a044294..f6104c08 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,8 +1,12 @@ # @summary Sets up default parameters # # @api private + class chocolatey::params { - $install_location = $facts['choco_install_path'] # default is C:\ProgramData\chocolatey + $install_location = empty($facts['choco_install_path']) ? { + false => $facts['choco_install_path'], + default => 'C:\ProgramData\chocolatey', + } $download_url = 'https://chocolatey.org/api/v2/package/chocolatey/' $use_7zip = false $seven_zip_download_url = 'https://chocolatey.org/7za.exe' diff --git a/metadata.json b/metadata.json index d817751b..23190ecb 100644 --- a/metadata.json +++ b/metadata.json @@ -57,6 +57,6 @@ "chocolatey professional" ], "pdk-version": "1.18.1", - "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-gd610ead" + "template-url": "https://github.com/puppetlabs/pdk-templates#main", + "template-ref": "remotes/origin/main-0-g8f10887" }