Skip to content

Commit

Permalink
Fix docker_worker_join_token evaluation
Browse files Browse the repository at this point in the history
When this fact was evaluated, an exception was raised:
Error: Facter: Error while resolving custom fact fact='docker_worker_join_token', resolution='<anonymous>': private method `execute' called for Facter::Util::Resolution:Class

Switch from Facter::Util::Resolution to Facter::Core::Execution and set
a time limit of 90s to match the rest of the file.
  • Loading branch information
smortex committed Sep 8, 2021
1 parent ed086a7 commit 918b3f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/facter/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ def interfaces

Facter.add(:docker_worker_join_token) do
setcode do
if Facter::Util::Resolution.which('docker')
val = Facter::Util::Resolution.execute(
"#{docker_command} swarm join-token worker -q",
if Facter::Core::Execution.which('docker')
val = Facter::Core::Execution.execute(
"#{docker_command} swarm join-token worker -q", options: { time_limit: 90 }
)
end
val
Expand All @@ -90,9 +90,9 @@ def interfaces

Facter.add(:docker_manager_join_token) do
setcode do
if Facter::Util::Resolution.which('docker')
val = Facter::Util::Resolution.execute(
"#{docker_command} swarm join-token manager -q",
if Facter::Core::Execution.which('docker')
val = Facter::Core::Execution.execute(
"#{docker_command} swarm join-token manager -q", options: { time_limit: 90 }
)
end
val
Expand Down

0 comments on commit 918b3f8

Please sign in to comment.