factor-connector-rackspace 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6c9716d20c7d4ae74a1db243c2c61ed03d43e74f
4
+ data.tar.gz: c93faf8957fa2f0357a96036dccc3c84c71392b0
5
+ SHA512:
6
+ metadata.gz: e0aaf9fa424685ba3b065c815f4845b6a2588a9d9758d768d724e83c158bef917c2c0577897a1b560d5ed5cae8278fd74b168761411c091a458f6416f197922a
7
+ data.tar.gz: 32a97f965a4746277aa3bae5e04a657cfae3535e75ad1ac1bf3eef6d3382a7736664f626245f2b75df8fa2dd77cbb2d03ec045cde21678ffdc18873010c2485e
@@ -26,7 +26,7 @@ Factor::Connector.service 'rackspace_compute' do
26
26
  fail "Couldn't initialize connection"
27
27
  end
28
28
 
29
- info "Retreiving list of servers"
29
+ info "Retrieving list of servers"
30
30
  begin
31
31
  servers = compute.servers.map {|s| s.attributes}
32
32
  rescue
@@ -61,7 +61,7 @@ Factor::Connector.service 'rackspace_compute' do
61
61
  fail "Couldn't initialize connection"
62
62
  end
63
63
 
64
- info "Retreiving servers"
64
+ info "Retrieving servers"
65
65
  begin
66
66
  server = compute.servers.get(server_id).attributes
67
67
  rescue
@@ -78,11 +78,13 @@ Factor::Connector.service 'rackspace_compute' do
78
78
  image_id = params['image_id']
79
79
  region = (params['region'] || 'ord').to_sym
80
80
  name = params['name']
81
+ wait = params['wait']
81
82
 
82
83
  fail "Username is required" unless username
83
84
  fail "API Key is required" unless api_key
84
85
  fail "Flavor ID is required" unless flavor_id
85
86
  fail "Image ID is required" unless image_id
87
+ fail "Name is required" unless name
86
88
 
87
89
 
88
90
  compute_settings = {
@@ -113,14 +115,18 @@ Factor::Connector.service 'rackspace_compute' do
113
115
  fail "Failed to create server with provided settings"
114
116
  end
115
117
 
116
- info "Waiting for the server. This can take a few minutes."
117
- begin
118
- server.wait_for { ready? }
119
- rescue
120
- fail "Server creation started, but couldn't get the status"
118
+ if wait
119
+ info "Waiting for the server. This can take a few minutes."
120
+ begin
121
+ server.wait_for { ready? }
122
+ server.reload
123
+ rescue
124
+ warn "Server creation started, but couldn't get the status"
125
+ end
126
+ else
127
+ info "Server creation has been queued"
121
128
  end
122
129
 
123
- server.reload
124
130
  server_info = server.attributes
125
131
 
126
132
  action_callback server_info
@@ -237,15 +243,20 @@ Factor::Connector.service 'rackspace_compute' do
237
243
  info "Retreiving server #{server_id}"
238
244
  begin
239
245
  server = compute.servers.get(server_id)
240
- server_info = server.attributes
241
246
  rescue
242
247
  fail "Failed to retrieve server #{server_id}"
243
248
  end
244
249
 
250
+ fail "Server #{server_id} wasn't found" unless server
251
+
245
252
  info "Executing commands on server #{server_id}"
246
253
  begin
247
254
  ssh_results = server.ssh(commands)
255
+ rescue
256
+ fail "Failed to execute commands on server #{server_id}"
257
+ end
248
258
 
259
+ begin
249
260
  call_response = ssh_results.map do |ssh_result|
250
261
  {
251
262
  status: ssh_result.status,
@@ -254,11 +265,11 @@ Factor::Connector.service 'rackspace_compute' do
254
265
  stdout: ssh_result.stdout
255
266
  }
256
267
  end
257
-
258
268
  rescue
259
- fail "Failed to execute commands on server #{server_id}"
269
+ fail "Failed to format output"
260
270
  end
261
271
 
272
+
262
273
  action_callback call_response
263
274
  end
264
275
 
@@ -26,7 +26,7 @@ Factor::Connector.service 'rackspace_compute_flavors' do
26
26
  fail "Couldn't initialize connection"
27
27
  end
28
28
 
29
- info "Retreiving list of flavors"
29
+ info "Retrieving list of flavors"
30
30
  begin
31
31
  flavors = compute.flavors.map {|s| s.attributes}
32
32
  rescue
@@ -61,7 +61,7 @@ Factor::Connector.service 'rackspace_compute_flavors' do
61
61
  fail "Couldn't initialize connection"
62
62
  end
63
63
 
64
- info "Retreiving flavor"
64
+ info "Retrieving flavor"
65
65
  begin
66
66
  flavor = compute.flavors.get(server_id).attributes
67
67
  rescue
@@ -26,7 +26,7 @@ Factor::Connector.service 'rackspace_compute_images' do
26
26
  fail "Couldn't initialize connection"
27
27
  end
28
28
 
29
- info "Retreiving list of images"
29
+ info "Retrieving list of images"
30
30
  begin
31
31
  images = compute.images.map {|s| s.attributes}
32
32
  rescue
@@ -61,7 +61,7 @@ Factor::Connector.service 'rackspace_compute_images' do
61
61
  fail "Couldn't initialize connection"
62
62
  end
63
63
 
64
- info "Retreiving image"
64
+ info "Retrieving image"
65
65
  begin
66
66
  image = compute.images.get(server_id).attributes
67
67
  rescue
metadata CHANGED
@@ -1,48 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factor-connector-rackspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
5
- prerelease:
4
+ version: 0.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Maciej Skierkowski
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-10-02 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: factor-connector-api
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: 0.0.3
19
+ version: 0.0.13
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: 0.0.3
26
+ version: 0.0.13
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: fog
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
- version: 1.23.0
33
+ version: 1.24.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
- version: 1.23.0
40
+ version: 1.24.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: codeclimate-test-reporter
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.4.1
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.4.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 3.1.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 3.1.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 10.3.2
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 10.3.2
83
+ - !ruby/object:Gem::Dependency
84
+ name: wrong
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.7.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.7.1
46
97
  description:
47
98
  email:
48
99
  - maciej@factor.io
@@ -55,26 +106,25 @@ files:
55
106
  - lib/factor/connector/rackspace_compute_images.rb
56
107
  homepage: https://factor.io
57
108
  licenses: []
109
+ metadata: {}
58
110
  post_install_message:
59
111
  rdoc_options: []
60
112
  require_paths:
61
113
  - lib
62
114
  required_ruby_version: !ruby/object:Gem::Requirement
63
- none: false
64
115
  requirements:
65
- - - ! '>='
116
+ - - ">="
66
117
  - !ruby/object:Gem::Version
67
118
  version: '0'
68
119
  required_rubygems_version: !ruby/object:Gem::Requirement
69
- none: false
70
120
  requirements:
71
- - - ! '>='
121
+ - - ">="
72
122
  - !ruby/object:Gem::Version
73
123
  version: '0'
74
124
  requirements: []
75
125
  rubyforge_project:
76
- rubygems_version: 1.8.25
126
+ rubygems_version: 2.2.2
77
127
  signing_key:
78
- specification_version: 3
128
+ specification_version: 4
79
129
  summary: Rackspace Factor.io Connector
80
130
  test_files: []