Class: Capistrano_karaf::Backend::KarafCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano-karaf/backends/opensshproxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeKarafCommand



8
9
10
11
12
# File 'lib/capistrano-karaf/backends/opensshproxy.rb', line 8

def initialize
  @karaf_username = fetch :karaf_username, "smx"
  @karaf_password = fetch :karaf_password, "smx"
  @karaf_port = fetch :karaf_port, "8101"
end

Instance Attribute Details

#karaf_passwordObject (readonly)

Returns the value of attribute karaf_password.



6
7
8
# File 'lib/capistrano-karaf/backends/opensshproxy.rb', line 6

def karaf_password
  @karaf_password
end

#karaf_portObject (readonly)

Returns the value of attribute karaf_port.



6
7
8
# File 'lib/capistrano-karaf/backends/opensshproxy.rb', line 6

def karaf_port
  @karaf_port
end

#karaf_usernameObject (readonly)

Returns the value of attribute karaf_username.



6
7
8
# File 'lib/capistrano-karaf/backends/opensshproxy.rb', line 6

def karaf_username
  @karaf_username
end

Instance Method Details

#create(*args) ⇒ Object



14
15
16
17
18
19
# File 'lib/capistrano-karaf/backends/opensshproxy.rb', line 14

def create(*args)
  command = args.shift.to_s.strip
  command1 = SSHKit.config.command_map[command.to_sym].split(' ')
  args1 = command1.concat(args)
  ["sshpass", "-p", karaf_password, "ssh", "-o", "NoHostAuthenticationForLocalhost=yes", "-o", "StrictHostKeyChecking=no", "#{karaf_username}@localhost", "-p", karaf_port].concat(args1)
end