summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-07-02 22:20:07 -0700
committerGitHub <noreply@github.com>2021-07-02 22:20:07 -0700
commit195433cbaff29023214b0dbc1298967ddb5c576f (patch)
treed98370fd6ccb38a708c3947db8115712f5f4d342
parentf44dc882c96f2ffe1f28aa886e4bc59d2f31329b (diff)
parent96d02863df2dd323cc026a192dc7b3fa823ba33b (diff)
downloadohai-195433cbaff29023214b0dbc1298967ddb5c576f.tar.gz
Merge pull request #1679 from chef/github
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--.expeditor/config.yml5
-rw-r--r--.expeditor/verify.pipeline.yml51
-rw-r--r--.github/dependabot.yml1
-rw-r--r--.github/workflows/exec.yml23
-rw-r--r--.github/workflows/lint.yml20
-rw-r--r--.github/workflows/unit.yml23
-rw-r--r--Gemfile2
-rw-r--r--lib/ohai/plugins/linux/network.rb2
8 files changed, 69 insertions, 58 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml
index ec4a8eec..21c7e253 100644
--- a/.expeditor/config.yml
+++ b/.expeditor/config.yml
@@ -56,8 +56,3 @@ subscriptions:
actions:
- built_in:rollover_changelog
- built_in:publish_rubygems
-
-pipelines:
- - verify:
- description: Pull Request validation tests
- public: true
diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml
deleted file mode 100644
index 91b93a8e..00000000
--- a/.expeditor/verify.pipeline.yml
+++ /dev/null
@@ -1,51 +0,0 @@
----
-expeditor:
- defaults:
- buildkite:
- retry:
- automatic:
- limit: 1
- timeout_in_minutes: 30
-
-steps:
-- label: lint-chefstyle
- command:
- - .expeditor/run_linux_tests.sh "rake style"
- expeditor:
- executor:
- docker:
- image: ruby:2.7-buster
-
-- label: run-ohai
- command:
- - .expeditor/run_linux_tests.sh "bundle exec ohai"
- expeditor:
- executor:
- docker:
- image: ruby:2.7-buster
-
-- label: run-specs-ruby-2.7
- command:
- - .expeditor/run_linux_tests.sh rspec
- expeditor:
- executor:
- docker:
- image: ruby:2.7-buster
-
-- label: run-specs-ruby-3.0
- command:
- - .expeditor/run_linux_tests.sh rspec
- expeditor:
- executor:
- docker:
- image: ruby:3.0-buster
-
-- label: run-specs-windows
- command:
- - bundle install --jobs=7 --retry=3 --without=profile
- - bundle exec rake spec
- expeditor:
- executor:
- docker:
- host_os: windows
- image: rubydistros/windows-2019:2.7
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index fd5a504f..83190062 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,3 +1,4 @@
+---
version: 2
updates:
- package-ecosystem: bundler
diff --git a/.github/workflows/exec.yml b/.github/workflows/exec.yml
new file mode 100644
index 00000000..dc64b76e
--- /dev/null
+++ b/.github/workflows/exec.yml
@@ -0,0 +1,23 @@
+---
+name: exec
+
+'on':
+ pull_request:
+ push:
+ branches:
+ - master
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ ruby: ['2.7', '3.0']
+ name: Unit test on Ruby ${{ matrix.ruby }}
+ steps:
+ - uses: actions/checkout@v2
+ - uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ bundler-cache: true
+ - run: bundle exec ohai
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 00000000..797e202c
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,20 @@
+---
+name: lint
+
+'on':
+ pull_request:
+ push:
+ branches:
+ - master
+
+jobs:
+ chefstyle:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: 2.7
+ bundler-cache: true
+ - uses: r7kamura/rubocop-problem-matchers-action@v1 # this shows the failures in the PR
+ - run: bundle exec chefstyle
diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml
new file mode 100644
index 00000000..82b5e7b7
--- /dev/null
+++ b/.github/workflows/unit.yml
@@ -0,0 +1,23 @@
+---
+name: unit
+
+'on':
+ pull_request:
+ push:
+ branches:
+ - master
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ ruby: ['2.7', '3.0']
+ name: Unit test on Ruby ${{ matrix.ruby }}
+ steps:
+ - uses: actions/checkout@v2
+ - uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ bundler-cache: true
+ - run: bundle exec rake spec
diff --git a/Gemfile b/Gemfile
index 0360f092..28b28584 100644
--- a/Gemfile
+++ b/Gemfile
@@ -9,7 +9,7 @@ gem "chef-utils", git: "https://github.com/chef/chef", branch: "master", glob: "
# NOTE: do not submit PRs to add pry as a dep, add to your Gemfile.local
group :development do
- gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "master"
+ gem "chefstyle", "2.0.5"
gem "ipaddr_extensions"
gem "rake", ">= 10.1.0"
gem "rspec-collection_matchers", "~> 1.0"
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb
index 80168e39..01380336 100644
--- a/lib/ohai/plugins/linux/network.rb
+++ b/lib/ohai/plugins/linux/network.rb
@@ -80,7 +80,7 @@ Ohai.plugin(:Network) do
line.strip!
logger.trace("Plugin Network: Parsing #{line}")
if /\\/.match?(line)
- parts = line.split('\\')
+ parts = line.split("\\")
route_dest = parts.shift.strip
route_endings = parts
elsif line =~ /^([^\s]+)\s(.*)$/