masamune 0.17.1 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 539cdf75fd7e8734d5ad8393a80c1fe389ca1e52
|
4
|
+
data.tar.gz: fea5c3e3908578febd63ac0a1e959c30442b5e09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06705c4e419adb0b2ffb82d35b80e92cfca1148f97c638880277f06d6f52731354915a9a3e468fdeec4f0874a5da7c6213660e5bc0df70e8ed5a104b3885d361
|
7
|
+
data.tar.gz: b6c98cdbe32f2f83ce54835243da0c1f060f5dfca1500dd6366a99d3fb7b77e4f181b373dac32eb388d027840b796820e0979b71c03445f75d2520032a3d3966
|
@@ -77,7 +77,7 @@ module Masamune::Commands
|
|
77
77
|
def ssh_command
|
78
78
|
@ssh_command ||= begin
|
79
79
|
result = nil
|
80
|
-
execute(*ssh_args, fail_fast: true, safe: true) do |line|
|
80
|
+
execute(*ssh_args, env: command_env, fail_fast: true, safe: true) do |line|
|
81
81
|
next if result
|
82
82
|
if line =~ /exit\Z/
|
83
83
|
result = line.sub(/ exit\Z/, '').split(' ')
|
data/lib/masamune/version.rb
CHANGED
@@ -52,5 +52,12 @@ describe Masamune::Actions::Execute do
|
|
52
52
|
|
53
53
|
it { expect { |b| instance.execute(*command, options, &b) }.to yield_with_args('pong', 0) }
|
54
54
|
end
|
55
|
+
|
56
|
+
context 'with a simple command with env' do
|
57
|
+
let(:command) { %Q(bash -c "echo $MESSAGE") }
|
58
|
+
let(:options) { {env: { 'MESSAGE' => 'pong' }, fail_fast: true} }
|
59
|
+
|
60
|
+
it { expect { |b| instance.execute(*command, options, &b) }.to yield_with_args('pong', 0) }
|
61
|
+
end
|
55
62
|
end
|
56
63
|
end
|
@@ -49,10 +49,10 @@ describe Masamune::Commands::AwsEmr do
|
|
49
49
|
|
50
50
|
context 'with --cluster-id j-XYZ' do
|
51
51
|
let(:delegate) { double(command_args: ['hive', '-e', "'show tables;'"]) }
|
52
|
-
let(:attrs) { { cluster_id: 'j-XYZ' } }
|
52
|
+
let(:attrs) { { config_file: '/etc/aws_config', cluster_id: 'j-XYZ' } }
|
53
53
|
|
54
54
|
before do
|
55
|
-
expect(instance).to receive(:execute).with('aws', 'emr', 'ssh', '--cluster-id', 'j-XYZ', '--command', 'exit', {fail_fast: true, safe: true}).
|
55
|
+
expect(instance).to receive(:execute).with('aws', 'emr', 'ssh', '--cluster-id', 'j-XYZ', '--command', 'exit', {env: {"AWS_CONFIG_FILE"=>"/etc/aws_config"}, fail_fast: true, safe: true}).
|
56
56
|
and_yield('ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=10 -i /etc/ssh/aws.key hadoop@ec2-10.0.0.1.compute-1.amazonaws.com exit').
|
57
57
|
and_yield("Warning: Permanently added 'ec2-10.0.0.1.compute-1.amazonaws.com,10.0.0.1' (ECDSA) to the list of known hosts.")
|
58
58
|
end
|