fog-softlayer 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWMzMWI0MTk1OTA5MTA1ZDc1MmFlMDVmYzA4MjM1MzNmODAyOGYxZQ==
5
- data.tar.gz: !binary |-
6
- MjQwYjI3YmEzNmNkMWNiMWU0NWY3ZDM4NDViOTI5MWZlZmEyZDVlNg==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- MWNlNTM4Mzk4N2ZkMjZmY2QxMzdlODdlYzdlMGZkOWYxMDU3NDEyMGU3MmVm
10
- ZmI3OTVjZWQ4MzQ5ZGY1ZjZjMTNhYjQ0ZGM3YTM3MWQwZGExMjdhY2I5OWJj
11
- OTU3YzFmNDZlOGIxZGJiYzdkOTMwNjY2MDdiY2IyY2QzYWFmZWQ=
12
- data.tar.gz: !binary |-
13
- NjIxNWNkZWM5ZTMzOWI3MjhkY2E2OGYzZTkwMWQzZTM2Yjk3ZjM0MjU1ZjBj
14
- OTM0NDc3MTllZjliZjExODczM2EwM2FiZGJiN2JlNGM0MzEyNzI5NWU5ZWM5
15
- MzQwYjQ5NzY2NGQwNzM2ZDZhOTk4OTJhODI0NmMxOGQzMmM4Mjg=
1
+ ---
2
+ SHA512:
3
+ data.tar.gz: ce77cb11421280fddba5c1b5eb5b6f1ee5e758db4ecb996d07705e3094cf8b30203792e3238e9f061f97f30a9de7e2068993dfd24d5597e3d819a8286e1dc215
4
+ metadata.gz: 05f842025b5ada86054bc9a9bae1f9018eab6840f17fbf914019cc49f9fff796e3bdc4a81e1c7e22b1f543f00846339b1fac3e0bc794a62db9240e553d1e3bb6
5
+ SHA1:
6
+ data.tar.gz: 0679efb2653ce4f5598f963e2befa614b471973c
7
+ metadata.gz: f75143038ed0f4d1daa5439d0783d0b167168d03
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_dependency "fog-core"
23
23
  spec.add_dependency "fog-json"
24
- spec.add_dependency("pry-debugger")
25
24
 
26
25
  spec.add_development_dependency "bundler", "~> 1.3"
27
26
  spec.add_development_dependency "rake"
@@ -55,7 +55,7 @@ module Fog
55
55
  super(args)
56
56
  end
57
57
 
58
- def request(method, path, expected_responses, parameters = {})
58
+ def request(method, path, parameters = {})
59
59
  _request
60
60
  end
61
61
 
@@ -31,7 +31,7 @@ module Fog
31
31
  end
32
32
 
33
33
  def self.valid_request?(required, passed)
34
- required.all? {|k| passed.key?(k) and !passed[k].nil?}
34
+ required.all? {|k| k = k.to_sym; passed.key?(k) and !passed[k].nil?}
35
35
  end
36
36
 
37
37
  end
@@ -12,7 +12,7 @@ module Fog
12
12
 
13
13
  class Server < Fog::Compute::Server
14
14
 
15
- identity :id
15
+ identity :id, :type => :integer
16
16
  attribute :name, :aliases => 'hostname'
17
17
  attribute :domain
18
18
  attribute :fqdn, :aliases => 'fullyQualifiedDomainName'
@@ -159,14 +159,16 @@ module Fog
159
159
  def save
160
160
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
161
161
 
162
+ copy = self.dup
163
+ copy.pre_save
164
+
162
165
  data = if bare_metal?
163
- pre_save
164
- service.create_bare_metal_server(attributes).body
166
+ service.create_bare_metal_server(copy.attributes).body
165
167
  else
166
- pre_save
167
- service.create_vm(attributes).body
168
+ service.create_vm(copy.attributes).body.first
168
169
  end
169
- merge_attributes(data.first)
170
+
171
+ merge_attributes(data)
170
172
  true
171
173
  end
172
174
 
@@ -243,7 +245,7 @@ module Fog
243
245
  def set_defaults
244
246
  attributes[:hourly_billing_flag] = true if attributes[:hourly_billing_flag].nil?
245
247
  attributes[:ephemeral_storage] = false if attributes[:ephemeral_storage].nil?
246
- attributes[:domain] = service.default_domain if attributes[:domain].nil?
248
+ attributes[:domain] = service.default_domain if service.default_domain and attributes[:domain].nil?
247
249
  end
248
250
 
249
251
  end
@@ -35,7 +35,7 @@ module Fog
35
35
  def create_vms(opts)
36
36
  raise ArgumentError, "Fog::Compute::Softlayer#create_vms expects argument of type Array" unless opts.kind_of?(Array)
37
37
  response = Excon::Response.new
38
- required = %w{hostname domain startCpus maxMemory hourlyBillingFlag localDiskFlag operatingSystemReferenceCode}
38
+ required = %w{hostname domain startCpus maxMemory hourlyBillingFlag localDiskFlag}
39
39
 
40
40
  begin
41
41
  opts.each {|vm| Fog::Softlayer.valid_request?(required, vm) or raise MissingRequiredParameter}
@@ -44,23 +44,23 @@ module Fog
44
44
 
45
45
  ## stub some responses
46
46
  fields = {
47
- "accountId" => Fog::Softlayer.mock_account_id,
48
- "createDate" => Time.now.iso8601,
49
- "dedicatedAccountHostOnlyFlag" => false,
50
- "domain" => nil,
51
- "fullyQualifiedDomainName" => nil,
52
- "hostname" => nil,
53
- "id" => Fog::Softlayer.mock_vm_id,
54
- "lastPowerStateId" => nil,
55
- "lastVerifiedDate" => nil,
56
- "maxCpu" => nil,
57
- "maxCpuUnits" => "CORE",
58
- "maxMemory" => nil,
59
- "metricPollDate" => nil,
60
- "modifyDate" => nil,
61
- "startCpus" => nil,
62
- "statusId" => 1001,
63
- "globalIdentifier" => Fog::Softlayer.mock_global_identifier
47
+ :accountId => Fog::Softlayer.mock_account_id,
48
+ :createDate => Time.now.iso8601,
49
+ :dedicatedAccountHostOnlyFlag => false,
50
+ :domain => nil,
51
+ :fullyQualifiedDomainName => nil,
52
+ :hostname => nil,
53
+ :id => Fog::Softlayer.mock_vm_id,
54
+ :lastPowerStateId => nil,
55
+ :lastVerifiedDate => nil,
56
+ :maxCpu => nil,
57
+ :maxCpuUnits => "CORE",
58
+ :maxMemory => nil,
59
+ :metricPollDate => nil,
60
+ :modifyDate => nil,
61
+ :startCpus => nil,
62
+ :statusId => 1001,
63
+ :globalIdentifier => Fog::Softlayer.mock_global_identifier
64
64
  }
65
65
 
66
66
  # clobber stubbed values where applicable
@@ -74,7 +74,7 @@ module Fog
74
74
  response.status = 500
75
75
  response.body = {
76
76
  "code" => "SoftLayer_Exception_MissingCreationProperty",
77
- "error" => "Properties #{required.join(', ')} ALL must be set to create an instance of 'SoftLayer_Hardware'."
77
+ "error" => "Properties #{required.join(', ')} ALL must be set to create an instance of 'SoftLayer_Virtual_Guest'."
78
78
  }
79
79
  end
80
80
  @virtual_guests.push(response.body).flatten!
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Softlayer
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,106 +1,71 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: fog-softlayer
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Matt Eldridge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-25 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
11
+
12
+ date: 2014-04-26 00:00:00 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
14
15
  name: fog-core
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
16
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ! '>='
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: fog-json
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - &id002
20
+ - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
34
23
  type: :runtime
24
+ version_requirements: *id001
25
+ - !ruby/object:Gem::Dependency
26
+ name: fog-json
35
27
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: pry-debugger
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
28
+ requirement: &id003 !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - *id002
48
31
  type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
32
+ version_requirements: *id003
33
+ - !ruby/object:Gem::Dependency
56
34
  name: bundler
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: '1.3'
62
- type: :development
63
35
  prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
36
+ requirement: &id004 !ruby/object:Gem::Requirement
37
+ requirements:
66
38
  - - ~>
67
- - !ruby/object:Gem::Version
68
- version: '1.3'
69
- - !ruby/object:Gem::Dependency
70
- name: rake
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ! '>='
74
- - !ruby/object:Gem::Version
75
- version: '0'
39
+ - !ruby/object:Gem::Version
40
+ version: "1.3"
76
41
  type: :development
42
+ version_requirements: *id004
43
+ - !ruby/object:Gem::Dependency
44
+ name: rake
77
45
  prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ! '>='
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: minitest
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ! '>='
88
- - !ruby/object:Gem::Version
89
- version: '0'
46
+ requirement: &id005 !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - *id002
90
49
  type: :development
50
+ version_requirements: *id005
51
+ - !ruby/object:Gem::Dependency
52
+ name: minitest
91
53
  prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ! '>='
95
- - !ruby/object:Gem::Version
96
- version: '0'
54
+ requirement: &id006 !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - *id002
57
+ type: :development
58
+ version_requirements: *id006
97
59
  description: Module for the 'fog' gem to support SoftLayer Cloud
98
- email:
60
+ email:
99
61
  - matt.eldridge@us.ibm.com
100
62
  executables: []
63
+
101
64
  extensions: []
65
+
102
66
  extra_rdoc_files: []
103
- files:
67
+
68
+ files:
104
69
  - .gitignore
105
70
  - CHANGELOG.md
106
71
  - Gemfile
@@ -129,31 +94,29 @@ files:
129
94
  - lib/fog/softlayer/requests/compute/get_vms.rb
130
95
  - lib/fog/softlayer/version.rb
131
96
  - spec/fog/compute/softlayer_spec.rb
132
- homepage: ''
133
- licenses:
97
+ homepage: ""
98
+ licenses:
134
99
  - MIT
135
100
  metadata: {}
101
+
136
102
  post_install_message:
137
103
  rdoc_options: []
138
- require_paths:
104
+
105
+ require_paths:
139
106
  - lib
140
- required_ruby_version: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - ! '>='
143
- - !ruby/object:Gem::Version
144
- version: '0'
145
- required_rubygems_version: !ruby/object:Gem::Requirement
146
- requirements:
147
- - - ! '>='
148
- - !ruby/object:Gem::Version
149
- version: '0'
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - *id002
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - *id002
150
113
  requirements: []
114
+
151
115
  rubyforge_project:
152
- rubygems_version: 2.2.2
116
+ rubygems_version: 2.1.11
153
117
  signing_key:
154
118
  specification_version: 4
155
- summary: This library can be used as a module for `fog` or as standalone provider
156
- to use the SoftLayer Cloud in applications
157
- test_files:
119
+ summary: This library can be used as a module for `fog` or as standalone provider to use the SoftLayer Cloud in applications
120
+ test_files:
158
121
  - spec/fog/compute/softlayer_spec.rb
159
122
  has_rdoc: