takelage 0.28.14 → 0.28.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 011a1f337984e2512deb1b67601fe20191a29d38d24b356c922f7c9e5e12a467
4
- data.tar.gz: 5decfcfd262bfb3466baa3a38b7ae80bb9d314838751ae4a17777915cb90edde
3
+ metadata.gz: 1a283a1e76877049cf7645c703c6bf2b17dcc3c7c13c1a5cac363441202f91b1
4
+ data.tar.gz: a53eb5c037d97b88d99e8bc4b9e9d5db17a2eb30b15fa993ac6a70924d5f9a36
5
5
  SHA512:
6
- metadata.gz: 279972fa01d7b84f786198d9abcd5f7757a3ef840b13d5d9f4de31032979ede3ab45ad5d21deb8d71f8ab806ac711e6cae17bf7389c8838e15efe68abd2aaba2
7
- data.tar.gz: 1e0c9eb0a468ff8fd5f4adbd0c969e3c2f466a5fbcdb9e0eeb0ca592ad31bcc5f11b0a0454a1fd5c819e46c545ea402ad131ab6b7b7cabe68eb105b23f7a67ad
6
+ metadata.gz: '05921e675c4136d159cf1e3e4e3774ea0e39a23bd4add0d4a0ce955b6e34806577ab63ddc9d14797799439e4abdde303b86471ef94c6a98ad24e196194e65416'
7
+ data.tar.gz: f0eb22800596daaefc3e6a8b2ccd9ea8df1d17e3ec547165bd795c98eedf06f02f310339406d6afb0164390b4fed7c88bc4b8b804b8f13c0db68f9665e33f3aa
data/README.md CHANGED
@@ -78,7 +78,6 @@ tau [bit scope list](features/cucumber/features/bit/bit.scope.list.feature) | Li
78
78
  tau [bit scope new](features/cucumber/features/bit/bit.scope.new.feature) [SCOPE] | Init a new bit [SCOPE]
79
79
  tau [completion bash](features/cucumber/features/completion/completion.bash.feature) | Print bash completion code
80
80
  tau [docker check daemon](features/cucumber/features/docker/docker.check.daemon.feature) | Check if docker daemon is running
81
- tau [docker check socat](features/cucumber/features/docker/docker.check.socat.feature) | Check if socat command is available
82
81
  tau [docker container check existing](features/cucumber/features/docker/docker.container.check.existing.feature) [CONTAINER] | Check if docker [CONTAINER] is existing
83
82
  tau [docker container check network](features/cucumber/features/docker/docker.container.check.network.feature) [NETWORK] | Check if docker [NETWORK] is existing
84
83
  tau [docker container check orphaned](features/cucumber/features/docker/docker.container.check.orphaned.feature) [CONTAINER] | Check if docker [CONTAINER] is orphaned
data/lib/takelage.rb CHANGED
@@ -49,7 +49,6 @@ require_relative 'takelage/mutagen/socket/create'
49
49
  require_relative 'takelage/mutagen/socket/terminate'
50
50
  require_relative 'takelage/mutagen/socket/tidy'
51
51
  require_relative 'takelage/docker/check/daemon'
52
- require_relative 'takelage/docker/check/socat'
53
52
  require_relative 'takelage/docker/check/cli'
54
53
  require_relative 'takelage/docker/socket/lib'
55
54
  require_relative 'takelage/docker/socket/host'
@@ -30,7 +30,6 @@ cmd_bit_scope_list_find_scopes: 'find -L %{root} -name scope.json'
30
30
  cmd_bit_scope_new_bit_init: 'mkdir -p %{root}/%{scope} && cd %{root}/%{scope} && bit init --bare'
31
31
  cmd_bit_scope_remove_scope: 'rm --force --recursive %{root}/%{scope}'
32
32
  cmd_docker_check_daemon_docker_info: 'docker info'
33
- cmd_docker_check_socat_which_socat: 'which socat'
34
33
  cmd_docker_container_check_existing_docker_ps: 'docker ps --filter name=^%{container}$ --quiet'
35
34
  cmd_docker_container_check_network_docker_network: 'docker network ls --quiet --filter name=^%{network}$'
36
35
  cmd_docker_container_check_orphaned_docker_exec: 'docker exec --interactive %{container} ps a'
@@ -7,7 +7,6 @@ module Takelage
7
7
  include SystemModule
8
8
  include ConfigModule
9
9
  include DockerCheckDaemon
10
- include DockerCheckSocat
11
10
 
12
11
  #
13
12
  # docker check daemon
@@ -20,17 +19,5 @@ module Takelage
20
19
  def daemon
21
20
  exit docker_check_daemon
22
21
  end
23
-
24
- #
25
- # docker check socat
26
- #
27
- desc 'socat', 'Check if socat command is available'
28
- long_desc <<-LONGDESC.gsub("\n", "\x5")
29
- Check if socat command is available
30
- LONGDESC
31
- # Check if socat command is available.
32
- def socat
33
- exit docker_check_socat
34
- end
35
22
  end
36
23
  end
@@ -1,12 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takelage docker check running
3
+ # takelage docker check daemon
4
4
  module DockerCheckDaemon
5
- # Backend method for docker check running.
5
+ # Backend method for docker check daemon.
6
6
  # @return [Boolean] is the docker daemon running?
7
+ # rubocop:disable Metrics/MethodLength
7
8
  def docker_check_daemon
8
9
  return true if @docker_daemon_running
9
10
 
11
+ return false unless command_available? 'docker'
12
+
10
13
  log.debug 'Check if the docker daemon is running'
11
14
 
12
15
  status = try config.active['cmd_docker_check_daemon_docker_info']
@@ -20,4 +23,5 @@ module DockerCheckDaemon
20
23
  @docker_daemon_running = true
21
24
  true
22
25
  end
26
+ # rubocop:enable Metrics/MethodLength
23
27
  end
@@ -7,7 +7,6 @@ module Takelage
7
7
  include SystemModule
8
8
  include ConfigModule
9
9
  include DockerCheckDaemon
10
- include DockerCheckSocat
11
10
  include DockerContainerCheckExisting
12
11
  include DockerContainerCheckNetwork
13
12
  include DockerContainerCheckOrphaned
@@ -7,7 +7,6 @@ module Takelage
7
7
  include SystemModule
8
8
  include ConfigModule
9
9
  include DockerCheckDaemon
10
- include DockerCheckSocat
11
10
  include DockerContainerCheckExisting
12
11
  include DockerContainerCheckNetwork
13
12
  include DockerContainerCheckOrphaned
@@ -7,7 +7,6 @@ module Takelage
7
7
  include SystemModule
8
8
  include ConfigModule
9
9
  include DockerCheckDaemon
10
- include DockerCheckSocat
11
10
  include DockerSocketLib
12
11
  include DockerSocketHost
13
12
  include DockerSocketScheme
@@ -8,7 +8,7 @@ module DockerSocketStart
8
8
 
9
9
  return false unless docker_check_daemon
10
10
 
11
- return false unless docker_check_socat
11
+ return false unless command_available? 'socat'
12
12
 
13
13
  cmds_start_socket = _docker_socket_lib_get_socket_start_commands 'start'
14
14
 
@@ -8,7 +8,7 @@ module DockerSocketStop
8
8
 
9
9
  return false unless docker_check_daemon
10
10
 
11
- return false unless docker_check_socat
11
+ return false unless command_available? 'socat'
12
12
 
13
13
  # get process list
14
14
  # assuming format: "pid command"
@@ -7,7 +7,6 @@ module Takelage
7
7
  include SystemModule
8
8
  include ConfigModule
9
9
  include DockerCheckDaemon
10
- include DockerCheckSocat
11
10
  include DockerContainerCheckExisting
12
11
  include DockerContainerCheckNetwork
13
12
  include DockerContainerCommand
@@ -5,7 +5,26 @@ require 'open3'
5
5
  require 'yaml'
6
6
 
7
7
  # Interaction with the operating system
8
+ # rubocop:disable Metrics/ModuleLength
8
9
  module SystemModule
10
+ # Check if a command is available
11
+ # @return [Boolean] is the command available?
12
+ def command_available?(command)
13
+ return true if instance_variable_get("@command_available_#{command}")
14
+
15
+ log.debug "Check if the command \"#{command}\" is available"
16
+
17
+ status = try "which #{command}"
18
+
19
+ unless status.exitstatus.zero?
20
+ log.debug "The command \"#{command}\" is not available"
21
+ return false
22
+ end
23
+
24
+ log.debug "The command \"#{command}\" is available"
25
+ instance_variable_set("@command_available_#{command}", true)
26
+ end
27
+
9
28
  # Convert hash to yaml.
10
29
  # @return [String] yaml of hash
11
30
  def hash_to_yaml(hash)
@@ -131,3 +150,4 @@ module SystemModule
131
150
  true
132
151
  end
133
152
  end
153
+ # rubocop:enable Metrics/ModuleLength
@@ -7,7 +7,6 @@ module Takelage
7
7
  include SystemModule
8
8
  include ConfigModule
9
9
  include DockerCheckDaemon
10
- include DockerCheckSocat
11
10
  include DockerContainerCheckExisting
12
11
  include DockerContainerCheckNetwork
13
12
  include DockerContainerCommand
@@ -9,28 +9,30 @@ module MutagenCheckDaemon
9
9
  def mutagen_check_daemon
10
10
  log.debug 'Check mutagen status'
11
11
 
12
+ return false unless command_available? 'mutagen'
13
+
12
14
  # are we outside of a takelage container?
13
15
  unless _docker_container_lib_check_matrjoschka
14
16
  unless _mutagen_check_daemon_version
15
- log.error 'mutagen is not available'
17
+ log.error 'The mutagen daemon is not available'
16
18
  return false
17
19
  end
18
20
 
19
- log.debug 'mutagen is available'
21
+ log.debug 'The mutagen daemon is available'
20
22
  return true
21
23
  end
22
24
 
23
25
  unless _file_exists? config.active['mutagen_socket_path']
24
- log.error 'mutagen socket is not available'
26
+ log.error 'The mutagen socket is not available'
25
27
  return false
26
28
  end
27
29
 
28
30
  unless _mutagen_check_daemon_host_connection
29
- log.error 'mutagen host connection is not available'
31
+ log.error 'A mutagen host connection is not available'
30
32
  return false
31
33
  end
32
34
 
33
- log.debug 'mutagen is available'
35
+ log.debug 'The mutagen daemon is available'
34
36
  true
35
37
  end
36
38
  # rubocop:enable Metrics/AbcSize
@@ -7,7 +7,6 @@ module Takelage
7
7
  include SystemModule
8
8
  include ConfigModule
9
9
  include DockerCheckDaemon
10
- include DockerCheckSocat
11
10
  include DockerContainerCheckExisting
12
11
  include DockerContainerCheckNetwork
13
12
  include DockerContainerCommand
data/lib/takelage/version CHANGED
@@ -1 +1 @@
1
- 0.28.14
1
+ 0.28.24
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takelage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.14
4
+ version: 0.28.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geospin
@@ -227,7 +227,6 @@ files:
227
227
  - lib/takelage/default.yml
228
228
  - lib/takelage/docker/check/cli.rb
229
229
  - lib/takelage/docker/check/daemon.rb
230
- - lib/takelage/docker/check/socat.rb
231
230
  - lib/takelage/docker/cli.rb
232
231
  - lib/takelage/docker/container/check/cli.rb
233
232
  - lib/takelage/docker/container/check/existing.rb
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # takelage docker check running
4
- module DockerCheckSocat
5
- # Backend method for docker check socat.
6
- # @return [Boolean] is the socat command available?
7
- def docker_check_socat
8
- return true if @socat_command_available
9
-
10
- log.debug 'Check if the socat command is available'
11
-
12
- status = try config.active['cmd_docker_check_socat_which_socat']
13
-
14
- unless status.exitstatus.zero?
15
- log.debug 'The socat command is not available'
16
- return false
17
- end
18
-
19
- log.debug 'The socat command is available'
20
- @socat_command_available = true
21
- true
22
- end
23
- end