Sha256: a1ec72c57d1d6fee70f0724d02415cfcb8b2ae23e10e7ee2ac08c8922b7530f9

Contents?: true

Size: 895 Bytes

Versions: 4

Compression:

Stored size: 895 Bytes

Contents

# frozen_string_literal: true

# tau docker container check network
module DockerContainerCheckNetwork
  # Backend method for docker container check network.
  # @return [Boolean] is network existing?
  def docker_container_check_network(network)
    log.debug "Checking if network \"#{network}\" is existing"

    return false unless docker_check_daemon

    stdout_str = run _docker_container_cmd_check_network network

    if stdout_str.to_s.chomp.empty?
      log.debug "Network \"#{network}\" is not existing"
      return false
    end

    log.debug "Network \"#{network}\" is existing"
    true
  end

  private

  # Prepare command to check if docker network exists.
  def _docker_container_cmd_check_network(network)
    format(
      config.active['cmd_docker_container_check_network_docker_network'],
      docker: config.active['cmd_docker'],
      network: network
    )
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
takeltau-0.43.16 lib/takeltau/docker/container/check/network.rb
takeltau-0.43.15 lib/takeltau/docker/container/check/network.rb
takeltau-0.43.14 lib/takeltau/docker/container/check/network.rb
takeltau-0.43.10 lib/takeltau/docker/container/check/network.rb