Module: OsCtl::Lib::Utils::Migration

Defined in:
lib/libosctl/utils/migration.rb

Instance Method Summary collapse

Instance Method Details

#migrate_ssh_cmd(key_chain, m_opts, cmd) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/libosctl/utils/migration.rb', line 3

def migrate_ssh_cmd(key_chain, m_opts, cmd)
  ret = [
    'ssh',
    '-o', 'StrictHostKeyChecking=no',
    '-T',
    '-p', m_opts[:port].to_s,
  ]

  ret.concat(['-i', key_chain.private_key_path]) if key_chain

  ret.concat([
    '-l', 'migration',
    m_opts[:dst],
    *cmd
  ])
end