diff options
author | Collin McNeese <cmcneese@chef.io> | 2021-02-15 12:39:41 -0600 |
---|---|---|
committer | Collin McNeese <cmcneese@chef.io> | 2021-02-15 12:39:41 -0600 |
commit | eff6db8ead16cecde361f1cd520ffe67b625cc71 (patch) | |
tree | a5bd62c042e19fd1ba1905a919fd3cf32b3676e1 | |
parent | 51f868c243acd267f91acfa6f5feda5a3ea37143 (diff) | |
download | ohai-eff6db8ead16cecde361f1cd520ffe67b625cc71.tar.gz |
linting fixes for pipeline
Signed-off-by: Collin McNeese <cmcneese@chef.io>
-rw-r--r-- | lib/ohai/plugins/habitat.rb | 3 | ||||
-rw-r--r-- | spec/unit/plugins/habitat_spec.rb | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/ohai/plugins/habitat.rb b/lib/ohai/plugins/habitat.rb index 0ae89865..870c8a3b 100644 --- a/lib/ohai/plugins/habitat.rb +++ b/lib/ohai/plugins/habitat.rb @@ -39,6 +39,7 @@ Ohai.plugin(:Habitat) do @service = {} fields = line.split(/\s+/) next unless fields[0].match?(%r{.*/.*/.*/.*}) # ignore header line + @service = {} @service[:identity] = fields[0] @service[:topology] = fields[1] @@ -50,7 +51,7 @@ Ohai.plugin(:Habitat) do end def fetch_habitat_services - services_shell_out = shell_out(["hab", "svc", "status"]).stdout + services_shell_out = shell_out(%w(hab svc status)).stdout load_habitat_service_via_cli(services_shell_out) if services_shell_out rescue Ohai::Exceptions::Exec logger.trace("Plugin Habitat: No detected version of hab binary found in PATH, skipping collection.") diff --git a/spec/unit/plugins/habitat_spec.rb b/spec/unit/plugins/habitat_spec.rb index 40396e10..ce5ca113 100644 --- a/spec/unit/plugins/habitat_spec.rb +++ b/spec/unit/plugins/habitat_spec.rb @@ -53,13 +53,13 @@ describe "plugin habitat" do identity: "origin1/package1/version1/release1", state_actual: "up", state_desired: "up", - topology: "standalone" + topology: "standalone", }) expect(plugin.habitat[:services]).to include({ identity: "origin2/package2/version2/release2", state_actual: "up", state_desired: "up", - topology: "standalone" + topology: "standalone", }) end end |