continuent-tools-core 0.10.6 → 0.10.7
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/providers/awsec2.rb +43 -35
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 61c0fd7050e745e23b953ed0a2deee4423eaff82
|
|
4
|
+
data.tar.gz: 4d1ad1829623ec32ea08a68408a7d1c41cb067a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 676a3ede37740ce80ad7eb803ef4a4cd11fee3b7bba4b23bedd5d142c662341d8ceaf42a7d60ecd5c719bb2576aa7503d894b3967d75c8738419c8d257f382e2
|
|
7
|
+
data.tar.gz: 8026fb1fe97b0b7fda0aadf846a064b487adec01cab01397c139144721f10e7ba6b518027da6389976c9ffe02ecb4a5c2c960f1fbd36eaaa1b44b24af65a4529
|
data/providers/awsec2.rb
CHANGED
|
@@ -75,55 +75,63 @@ class AWSEC2TungstenDirectoryProvider < TungstenDirectoryProvider
|
|
|
75
75
|
|
|
76
76
|
begin
|
|
77
77
|
region_ec2 = AWS::EC2.new(:region => region)
|
|
78
|
-
instances =
|
|
78
|
+
instances = nil
|
|
79
|
+
|
|
80
|
+
AWS.start_memoizing
|
|
81
|
+
AWS.memoize do
|
|
82
|
+
instances = region_ec2.instances().filter('instance-state-name', "running")
|
|
79
83
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
if aws_info.has_key?("tag_key")
|
|
85
|
+
if aws_info.has_key?("tag_value")
|
|
86
|
+
instances = instances.with_tag(aws_info["tag_key"], aws_info["tag_value"])
|
|
87
|
+
else
|
|
88
|
+
instances = instances.tagged(aws_info["tag_key"])
|
|
89
|
+
end
|
|
83
90
|
else
|
|
84
|
-
instances = instances.tagged(
|
|
91
|
+
instances = instances.tagged('tungsten-ServerType')
|
|
85
92
|
end
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
instances.each{
|
|
90
|
-
|ins|
|
|
91
|
-
tags = ins.tags.to_h()
|
|
93
|
+
instances.each{
|
|
94
|
+
|ins|
|
|
95
|
+
tags = ins.tags.to_h()
|
|
92
96
|
|
|
93
|
-
|
|
97
|
+
name = tags.to_h()[hostname_tag]
|
|
94
98
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
if name.to_s() == "" && require_hostname_tag == false
|
|
100
|
+
# Allow the DEFAULT_HOSTNAME_TAG to be used as a backup
|
|
101
|
+
name = tags.to_h()[DEFAULT_HOSTNAME_TAG]
|
|
102
|
+
end
|
|
99
103
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
if name.to_s() == ""
|
|
105
|
+
TU.error("Unable to identify the hostname for #{ins.id} in #{region}")
|
|
106
|
+
end
|
|
103
107
|
|
|
104
108
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
if ins.vpc_id != nil
|
|
110
|
+
location = ins.availability_zone + "." + ins.vpc_id
|
|
111
|
+
else
|
|
112
|
+
location = ins.availability_zone
|
|
113
|
+
end
|
|
110
114
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
TU.debug("Found #{ins.id}")
|
|
116
|
+
region_results[index][name] = {
|
|
117
|
+
'id' => ins.id.to_s(),
|
|
118
|
+
'hostname' => name,
|
|
119
|
+
'location' => location,
|
|
120
|
+
'public-address' => ins.public_ip_address,
|
|
121
|
+
'private-address' => ins.private_ip_address,
|
|
122
|
+
'tags' => tags.to_h(),
|
|
123
|
+
'provider' => "aws.ec2",
|
|
124
|
+
'autodetect-key' => @key
|
|
125
|
+
}
|
|
121
126
|
}
|
|
122
|
-
|
|
127
|
+
end
|
|
128
|
+
AWS.stop_memoizing
|
|
123
129
|
rescue AWS::EC2::Errors::AuthFailure => af
|
|
124
130
|
TU.debug("Unable to find instances in #{region}: #{af.message}. Operation will continue.")
|
|
131
|
+
AWS.stop_memoizing
|
|
125
132
|
rescue => e
|
|
126
133
|
TU.debug("Error finding instances in #{region}: #{e.message}")
|
|
134
|
+
AWS.stop_memoizing
|
|
127
135
|
raise e
|
|
128
136
|
end
|
|
129
137
|
}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: continuent-tools-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.10.
|
|
4
|
+
version: 0.10.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Continuent
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-09-
|
|
11
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json_pure
|