fog-google 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/create_instance.rb +1 -1
- data/lib/fog/compute/google/models/server.rb +22 -16
- data/lib/fog/google/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65e4868fbdd7a60000ea6a349ce4f693c39bd62c
|
4
|
+
data.tar.gz: 92c1d9a1f79427c290e499896a8d454eb9d78556
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d14851bab45918fec8f0d4cbb48ad6768b6ddeb298e0241f4b09b7ba918615251758ec22ef2636e1d481ee84ffae8bef4952107242a722523953141b1e2f799
|
7
|
+
data.tar.gz: 4236f7940f9f9d86362cd18ea0e0eccf466768f9ebcb3ae7a54d7c48bbbdfbff8139f06107f69837593cfb3a1684f5529b2c2e59b252fc1ea5f4040760d1c6cd
|
data/examples/create_instance.rb
CHANGED
@@ -25,7 +25,7 @@ def test
|
|
25
25
|
:private_key_path => File.expand_path("~/.ssh/id_rsa"),
|
26
26
|
:public_key_path => File.expand_path("~/.ssh/id_rsa.pub"),
|
27
27
|
:zone_name => "us-central1-f",
|
28
|
-
:
|
28
|
+
:username => ENV["USER"],
|
29
29
|
:tags => ["fog"],
|
30
30
|
:service_accounts => %w(sql-admin bigquery https://www.googleapis.com/auth/compute)
|
31
31
|
)
|
@@ -207,21 +207,7 @@ module Fog
|
|
207
207
|
end
|
208
208
|
|
209
209
|
def add_ssh_key(username, key)
|
210
|
-
|
211
|
-
|
212
|
-
# The key "sshKeys" is deprecated and will be unsupported in the
|
213
|
-
# future - for now defer to using 'ssh-keys' unless the user is
|
214
|
-
# already using the deprecated version
|
215
|
-
# https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#deprecated
|
216
|
-
metadata_key = metadata.key?("sshKeys") ? "sshKeys" : "ssh-keys"
|
217
|
-
|
218
|
-
# You can have multiple SSH keys, seperated by newlines.
|
219
|
-
# https://developers.google.com/compute/docs/console?hl=en#sshkeys
|
220
|
-
metadata[metadata_key] = "" unless metadata[metadata_key]
|
221
|
-
metadata[metadata_key] += "\n" unless metadata[metadata_key].empty?
|
222
|
-
metadata[metadata_key] += "#{username}:#{key.strip}"
|
223
|
-
|
224
|
-
set_metadata(metadata)
|
210
|
+
set_metadata(generate_ssh_key_metadata(username, key))
|
225
211
|
end
|
226
212
|
|
227
213
|
def map_service_accounts(scope_array)
|
@@ -259,7 +245,7 @@ module Fog
|
|
259
245
|
raise ArgumentError.new "#{zone_name.inspect} is either down or you don't have permission to use it."
|
260
246
|
end
|
261
247
|
|
262
|
-
|
248
|
+
generate_ssh_key_metadata(username, public_key) if public_key
|
263
249
|
|
264
250
|
options = {
|
265
251
|
"machineType" => machine_type,
|
@@ -289,6 +275,26 @@ module Fog
|
|
289
275
|
operation.wait_for { !pending? }
|
290
276
|
reload
|
291
277
|
end
|
278
|
+
|
279
|
+
private
|
280
|
+
|
281
|
+
def generate_ssh_key_metadata(username, key)
|
282
|
+
self.metadata = Hash.new("") if metadata.nil?
|
283
|
+
|
284
|
+
# The key "sshKeys" is deprecated and will be unsupported in the
|
285
|
+
# future - for now defer to using 'ssh-keys' unless the user is
|
286
|
+
# already using the deprecated version
|
287
|
+
# https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#deprecated
|
288
|
+
metadata_key = metadata.key?("sshKeys") ? "sshKeys" : "ssh-keys"
|
289
|
+
|
290
|
+
# You can have multiple SSH keys, seperated by newlines.
|
291
|
+
# https://developers.google.com/compute/docs/console?hl=en#sshkeys
|
292
|
+
metadata[metadata_key] = "" unless metadata[metadata_key]
|
293
|
+
metadata[metadata_key] += "\n" unless metadata[metadata_key].empty?
|
294
|
+
metadata[metadata_key] += "#{username}:#{key.strip}"
|
295
|
+
|
296
|
+
metadata
|
297
|
+
end
|
292
298
|
end
|
293
299
|
end
|
294
300
|
end
|
data/lib/fog/google/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-google
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nat Welch
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-01-
|
14
|
+
date: 2017-01-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: fog-core
|
@@ -725,7 +725,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
725
725
|
version: '0'
|
726
726
|
requirements: []
|
727
727
|
rubyforge_project:
|
728
|
-
rubygems_version: 2.5.1
|
728
|
+
rubygems_version: 2.4.5.1
|
729
729
|
signing_key:
|
730
730
|
specification_version: 4
|
731
731
|
summary: Module for the 'fog' gem to support Google.
|