Sha256: cce2a438204f3f572ec9853c2fcd32c9ddc36a26025246b27bed28d43e4d4c7d

Contents?: true

Size: 1.39 KB

Versions: 26

Compression:

Stored size: 1.39 KB

Contents

# frozen_string_literal: true

# tau mutagen socket create
module MutagenSocketCreate
  # Backend method for mutagen socket create.
  # rubocop:disable Metrics/MethodLength
  def mutagen_socket_create(name, containersock, hostsock)
    # See DockerContainerLib::_docker_container_lib_hostname
    socketname = "#{@hostname[-11..]}-#{name}"
    log.debug "Create the mutagen socket \"#{socketname}\" in the container " \
      "at \"#{containersock}\" pointing to the host at \"#{hostsock}\""

    return false if mutagen_socket_check socketname

    socket_created = _mutagen_socket_create_socket(socketname, containersock, hostsock)

    unless socket_created.include? 'Created session'
      log.debug "Unable to create mutagen socket \"#{socketname}\""
      return false
    end

    log.debug "Created the mutagen socket \"#{socketname}\""
    true
  end
  # rubocop:enable Metrics/MethodLength

  private

  # Get git branch.
  # rubocop:disable Metrics/MethodLength
  def _mutagen_socket_create_socket(socketname, containersock, hostsock)
    cmd_create_socket = format(
      config.active['cmd_mutagen_forward_socket_create'],
      socketname: socketname,
      containersock: containersock,
      hostsock: hostsock,
      username: @username,
      container: @hostname,
      hostlabel: @hostlabel,
      takellabel: @takellabel
    )
    run cmd_create_socket
  end
  # rubocop:enable Metrics/MethodLength
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
takeltau-0.44.14 lib/takeltau/mutagen/socket/create.rb
takeltau-0.44.12 lib/takeltau/mutagen/socket/create.rb
takeltau-0.44.11 lib/takeltau/mutagen/socket/create.rb
takeltau-0.44.8 lib/takeltau/mutagen/socket/create.rb
takeltau-0.44.2 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.23 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.21 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.19 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.16 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.15 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.14 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.10 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.6 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.4 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.2 lib/takeltau/mutagen/socket/create.rb
takeltau-0.43.1 lib/takeltau/mutagen/socket/create.rb
takeltau-0.42.7 lib/takeltau/mutagen/socket/create.rb
takeltau-0.42.5 lib/takeltau/mutagen/socket/create.rb
takeltau-0.42.4 lib/takeltau/mutagen/socket/create.rb
takeltau-0.42.3 lib/takeltau/mutagen/socket/create.rb