Sha256: bd05c864dcfb5723d639397f2457c4f52b4a09522ea0aed9cd4fd17cd00e53c6

Contents?: true

Size: 858 Bytes

Versions: 9

Compression:

Stored size: 858 Bytes

Contents

# frozen_string_literal: true

# takelage 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_running

    stdout_str = run _docker_container_cmd_check_network network

    if stdout_str.to_s.strip.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'],
      network: network
    )
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
takelage-0.23.0 lib/takelage/docker/container/check/network.rb
takelage-0.22.2 lib/takelage/docker/container/check/network.rb
takelage-0.22.1 lib/takelage/docker/container/check/network.rb
takelage-0.22.0 lib/takelage/docker/container/check/network.rb
takelage-0.21.1 lib/takelage/docker/container/check/network.rb
takelage-0.21.0 lib/takelage/docker/container/check/network.rb
takelage-0.20.2 lib/takelage/docker/container/check/network.rb
takelage-0.20.1 lib/takelage/docker/container/check/network.rb
takelage-0.20.0 lib/takelage/docker/container/check/network.rb