elecksee 1.1.2 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/elecksee/ephemeral.rb +1 -1
- data/lib/elecksee/lxc.rb +25 -12
- data/lib/elecksee/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21ad5852da8a7cc744f2373114236025f96250fd
|
4
|
+
data.tar.gz: f66e5479b7ca68ea91e64252fba2dd700c5744c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25db309c2ec9f98d618b374ad4f1025837868f7baf66c3bbe34bfa0c59a939587125929229a3a32317f38e033d994bf848e97e5db3725ba44405e73ba20790d3
|
7
|
+
data.tar.gz: 9284d75a3e4fcb38b4e6023084e886eea5a1e9887515025e800c9d97d4ce433883eb093e3e54914bd9ef8d65b0320ffbf3863728f4ab41c1927f0fd7c69d0b4b
|
data/CHANGELOG.md
CHANGED
data/lib/elecksee/ephemeral.rb
CHANGED
data/lib/elecksee/lxc.rb
CHANGED
@@ -53,6 +53,8 @@ class Lxc
|
|
53
53
|
attr_accessor :default_ssh_password
|
54
54
|
# @return [String, NilClass] default ssh user
|
55
55
|
attr_accessor :default_ssh_user
|
56
|
+
# @return [Symbol] default command method
|
57
|
+
attr_accessor :container_command_via
|
56
58
|
|
57
59
|
# @return [String] sudo command
|
58
60
|
def sudo
|
@@ -479,18 +481,25 @@ class Lxc
|
|
479
481
|
# @option args [TrueClass, FalseClass] :raise_on_failure
|
480
482
|
# @return [CommandResult]
|
481
483
|
def direct_container_command(command, args={})
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
484
|
+
if(args.fetch(:run_as, Lxc.container_command_via).to_sym == :ssh)
|
485
|
+
begin
|
486
|
+
result = connection(args).execute command
|
487
|
+
CommandResult.new(result)
|
488
|
+
rescue Rye::Err => e
|
489
|
+
if(args[:raise_on_failure])
|
490
|
+
raise CommandFailed.new(
|
491
|
+
"Command failed: #{command}",
|
492
|
+
CommandResult.new(e)
|
493
|
+
)
|
494
|
+
else
|
495
|
+
false
|
496
|
+
end
|
493
497
|
end
|
498
|
+
else
|
499
|
+
command(
|
500
|
+
"lxc-attach -n #{name} #{command}",
|
501
|
+
args.merge(:sudo => true)
|
502
|
+
)
|
494
503
|
end
|
495
504
|
end
|
496
505
|
alias_method :knife_container, :direct_container_command
|
@@ -576,5 +585,9 @@ EOS
|
|
576
585
|
|
577
586
|
end
|
578
587
|
|
579
|
-
Lxc.default_ssh_key =
|
588
|
+
Lxc.default_ssh_key = [
|
589
|
+
File.join(Dir.home, '.ssh', 'lxc_container_rsa'),
|
590
|
+
'/opt/hw-lxc-config/id_rsa',
|
591
|
+
].detect{|key| File.exists?(key) }
|
580
592
|
Lxc.default_ssh_user = 'root'
|
593
|
+
Lxc.container_command_via = :ssh
|
data/lib/elecksee/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elecksee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: childprocess
|
@@ -88,4 +88,3 @@ signing_key:
|
|
88
88
|
specification_version: 4
|
89
89
|
summary: LXC helpers
|
90
90
|
test_files: []
|
91
|
-
has_rdoc:
|