build-cloud 1.1.3 → 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 +2 -0
- data/build-cloud.gemspec +1 -1
- data/lib/build-cloud/subnet.rb +21 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b796de3789fd255b22a0bbb3c9b31b61b1a560fd9205b6766c6e0e8459a14d72
|
4
|
+
data.tar.gz: 107602ff83bfd883c99972559de45eb7a4f67e1eaa293419faf8f520212333b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8510ed1ab35448dd52567c7f5ea2a4136245e8d7e57467826d773a90ae7b933ffd016c716949d83492fb7f81d72f73f477888af2cf4c6fe969f43f21559fe3e2
|
7
|
+
data.tar.gz: 6aafc72ea07eb7211ccf714c64148a6dad287fd3118e52e88b5c6eaa1420485235f4af6d5cac70bdd31cff0f9293f2271d46b3650e96971f745d7a1f11d21d5a
|
data/CHANGELOG.md
CHANGED
data/build-cloud.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "build-cloud"
|
7
|
-
spec.version = "1.1.
|
7
|
+
spec.version = "1.1.4"
|
8
8
|
spec.authors = ["The Scale Factory"]
|
9
9
|
spec.email = ["info@scalefactory.com"]
|
10
10
|
spec.summary = %q{Tools for building resources in AWS}
|
data/lib/build-cloud/subnet.rb
CHANGED
@@ -36,13 +36,21 @@ class BuildCloud::Subnet
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def create
|
39
|
-
|
40
|
-
return if exists?
|
41
|
-
|
42
|
-
@log.info( "Creating subnet for #{@options[:cidr_block]} ( #{@options[:name]} )" )
|
43
39
|
|
44
40
|
options = @options.dup
|
45
41
|
|
42
|
+
if exists?
|
43
|
+
# If exists update tags
|
44
|
+
if options[:tags]
|
45
|
+
create_tags(options[:tags])
|
46
|
+
end
|
47
|
+
return
|
48
|
+
end
|
49
|
+
|
50
|
+
return if exists?
|
51
|
+
|
52
|
+
@log.info( "Creating subnet for #{@options[:cidr_block]} ( #{options[:name]} )" )
|
53
|
+
|
46
54
|
unless options[:vpc_id]
|
47
55
|
|
48
56
|
options[:vpc_id] = BuildCloud::VPC.get_id_by_name( options[:vpc_name] )
|
@@ -86,5 +94,14 @@ class BuildCloud::Subnet
|
|
86
94
|
|
87
95
|
end
|
88
96
|
|
97
|
+
def create_tags(tags)
|
98
|
+
# force symbols to strings in yaml tags
|
99
|
+
resolved_tags = fog_object.tag_set.dup.merge(tags.collect{|k,v| [k.to_s, v]}.to_h)
|
100
|
+
if resolved_tags != fog_object.tag_set
|
101
|
+
@log.info("Updating tags for subnet #{fog_object.subnet_id.to_s}")
|
102
|
+
@compute.create_tags( fog_object.subnet_id.to_s, tags )
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
89
106
|
end
|
90
107
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build-cloud
|
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
|
- The Scale Factory
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|