chake 0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +8 -0
- data/lib/chake/backend.rb +1 -1
- data/lib/chake/backend/ssh.rb +1 -1
- data/lib/chake/node.rb +2 -0
- data/lib/chake/version.rb +1 -1
- data/spec/chake/backend/ssh_spec.rb +11 -0
- data/spec/spec_helper.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1df478d2c90d2ca124065d8f29ea659cceb973f7
|
4
|
+
data.tar.gz: c0c875fe667e97d240b448a17f0cd1df3ee36580
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e374e3b0989135b0ad8f07d0efdae889d3e44e5013dc6427823cda3fc9c5eb9bdbef6fa85b2ef8b8a1e6aa853eee73bd09ee61f699ef6bdcb3e2887f087d8723
|
7
|
+
data.tar.gz: 98ca09e11b1fc6b4376f6497e49c2acdffc63a0bf6f68d23732518aacd35cd39c2b3e3dd60486d833ef28a7585635c55095b6a1dcb37c99aba4b3d3922b9d0f8
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 0.4.1
|
2
|
+
|
3
|
+
* Don't always assume the local username as the remote username for SSH
|
4
|
+
connections:
|
5
|
+
* `user@host`: connect with `user@host`
|
6
|
+
* `host`: connect with `host` (username will be obtained by SSH itself from
|
7
|
+
either its configuration files or the current username)
|
8
|
+
|
1
9
|
# 0.4.0
|
2
10
|
|
3
11
|
* Redesign build of RPM package
|
data/lib/chake/backend.rb
CHANGED
data/lib/chake/backend/ssh.rb
CHANGED
data/lib/chake/node.rb
CHANGED
@@ -12,6 +12,7 @@ module Chake
|
|
12
12
|
|
13
13
|
attr_reader :hostname
|
14
14
|
attr_reader :username
|
15
|
+
attr_reader :remote_username
|
15
16
|
attr_reader :path
|
16
17
|
attr_reader :data
|
17
18
|
|
@@ -35,6 +36,7 @@ module Chake
|
|
35
36
|
|
36
37
|
@hostname = uri.host
|
37
38
|
@username = uri.user || Etc.getpwuid.name
|
39
|
+
@remote_username = uri.user
|
38
40
|
@path = uri.path || "/var/tmp/chef.#{username}"
|
39
41
|
@data = data
|
40
42
|
|
data/lib/chake/version.rb
CHANGED
@@ -10,4 +10,15 @@ describe Chake::Backend::Ssh do
|
|
10
10
|
|
11
11
|
it('rsyncs over ssh') { expect(backend.rsync_dest).to eq('myuser@myhost:/srv/chef/') }
|
12
12
|
|
13
|
+
it 'uses no remote username if none was passed' do
|
14
|
+
node = Chake::Node.new('theserver')
|
15
|
+
expect(node.username).to eq(Etc.getpwuid.name)
|
16
|
+
expect(node.remote_username).to be_nil
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'uses username is passwd' do
|
20
|
+
expect(node.username).to eq('myuser')
|
21
|
+
expect(node.remote_username).to eq('myuser')
|
22
|
+
end
|
23
|
+
|
13
24
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -26,7 +26,7 @@ shared_examples "Chake::Backend" do |backend_class|
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it('does not use sudo if already root') do
|
29
|
-
allow(backend.node).to receive(:
|
29
|
+
allow(backend.node).to receive(:remote_username).and_return('root')
|
30
30
|
expect(backend).to receive(:run).with('something')
|
31
31
|
backend.run_as_root('something')
|
32
32
|
end
|