opsworks 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/opsworks/commands/ssh.rb +8 -3
- data/lib/opsworks/meta.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: a24c300ec4ca258fd1d93d50d8d7d9673bc06b6b
|
|
4
|
+
data.tar.gz: db3f12062346f283a16ea57f92967f6f9875a964
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90a7af50d584a6cbce7e13d9d6ccf2e38fa818507514073d5aeffec29c74750b6a6f9dbb09468eaf38404d4f65005b745d5241a62fdf0e46edcb4c7dc4e9ffd5
|
|
7
|
+
data.tar.gz: a00a6474a69df20cf59805ba82f49af1172be6ed30b9ecf81ea15fc958e90aa88da882689fc00fbd631b87a3121863ef3011673580135ef33c90d39fa7b94b84
|
|
@@ -4,7 +4,7 @@ require 'trollop'
|
|
|
4
4
|
require 'opsworks'
|
|
5
5
|
|
|
6
6
|
SSH_PREFIX = "# --- OpsWorks ---"
|
|
7
|
-
SSH_POSTFIX = "# --- End of OpsWorks
|
|
7
|
+
SSH_POSTFIX = "# --- End of OpsWorks ---"
|
|
8
8
|
|
|
9
9
|
module OpsWorks::Commands
|
|
10
10
|
class SSH
|
|
@@ -53,7 +53,9 @@ module OpsWorks::Commands
|
|
|
53
53
|
parameters.map{ |param| param.join(" ") }.join("\n ")
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
-
new_contents = "\n
|
|
56
|
+
new_contents = "\n\n#{SSH_PREFIX}\n" <<
|
|
57
|
+
"#{instances.join("\n")}\n" <<
|
|
58
|
+
"#{SSH_POSTFIX}\n\n"
|
|
57
59
|
|
|
58
60
|
if options[:update]
|
|
59
61
|
ssh_config = "#{ENV['HOME']}/.ssh/config"
|
|
@@ -74,7 +76,10 @@ module OpsWorks::Commands
|
|
|
74
76
|
end
|
|
75
77
|
|
|
76
78
|
File.open(ssh_config, "w") do |file|
|
|
77
|
-
file.puts old_contents.gsub(
|
|
79
|
+
file.puts old_contents.gsub(
|
|
80
|
+
/\n?\n?#{SSH_PREFIX}.*#{SSH_POSTFIX}\n?\n?/m,
|
|
81
|
+
''
|
|
82
|
+
)
|
|
78
83
|
file.puts new_contents
|
|
79
84
|
end
|
|
80
85
|
|
data/lib/opsworks/meta.rb
CHANGED