ey-core 3.2.4 → 3.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b489ceaf6f7e474b2337f96fc3eafb224a937d99
4
- data.tar.gz: 306111004fbbe08ad7e9983098081eae13ec7910
3
+ metadata.gz: d0f3833d05cac75ec11d7fe518652eb51ea835aa
4
+ data.tar.gz: 5ad5a49994ddcedc0f6ca9ad50d8640e0d6dbedc
5
5
  SHA512:
6
- metadata.gz: f0c15aea22fd0c244b5240cb41c0b422c64e4721786ba1e4e2f8827b46bfb25e120ee58a5054b742e9b5218d38ed311d46cacdcbbbe8a1d3e20b85ed24a1feac
7
- data.tar.gz: cc9fe75f9ea736248b7113ee69535874a186be4c122e02aa174d74e0289bf7104876e189a19ba34d582fce241a07b832168dab6a5659e1956cffb5a0841c85a3
6
+ metadata.gz: 21953fe50f30dcd32c333ca2af941e6daa9dd357bb8a660b51335a2344aa55106a91df8424e83edd6ac262861328558e29b14f863d5b01fb0837fb27dd9428cc
7
+ data.tar.gz: 889858ed3b518c9957135562f7c0d567930f2d882b511919a15f69f9b2b0ca0aebf6570b5afff316f06ff2cbea634f2fefbb12d57a5becdb5eb5f27357465f0d
@@ -119,6 +119,7 @@ module Ey
119
119
  def core_client
120
120
  @core_client ||= begin
121
121
  opts = {url: core_url, config_file: self.class.core_file}
122
+ opts.merge!(token: ENV["CORE_TOKEN"]) if ENV["CORE_TOKEN"]
122
123
  if ENV["DEBUG"]
123
124
  opts[:logger] = ::Logger.new(STDOUT)
124
125
  end
@@ -340,7 +340,9 @@ class Ey::Core::Client < Cistern::Service
340
340
  end
341
341
 
342
342
  @authentication = nil
343
- @token = if options.has_key?(:token) && options[:token].nil?
343
+ @token = if ENV["CORE_TOKEN"]
344
+ ENV["CORE_TOKEN"]
345
+ elsif options.has_key?(:token) && options[:token].nil?
344
346
  @authentication = :none
345
347
  else
346
348
  options[:token] || token_dotfile[@url] || token_dotfile[@url.gsub(/\/$/, "")] # matching with or without trailing slash
@@ -4,6 +4,7 @@ class Ey::Core::Client::Server < Ey::Core::Model
4
4
  identity :id, type: :integer
5
5
 
6
6
  attribute :created_at, type: :time
7
+ attribute :dedicated, type: :boolean
7
8
  attribute :deleted_at, type: :time
8
9
  attribute :deprovisioned_at, type: :time
9
10
  attribute :devices, type: :array
@@ -107,14 +108,15 @@ class Ey::Core::Client::Server < Ey::Core::Model
107
108
  "snapshot" => self.snapshot_id,
108
109
  "force" => self.force,
109
110
  "server" => {
111
+ "dedicated" => self.dedicated,
110
112
  "flavor" => self.flavor_id,
111
113
  "iops" => self.iops,
112
114
  "location" => self.location || environment.region,
113
115
  "mnt_volume_size" => self.mnt_volume_size,
114
116
  "name" => self.name,
117
+ "release_label" => self.release_label,
115
118
  "role" => self.role,
116
119
  "volume_size" => self.volume_size,
117
- "release_label" => self.release_label,
118
120
  }
119
121
  }
120
122
  connection.requests.new(connection.create_server(server_attributes).body["request"])
@@ -115,6 +115,7 @@ class Ey::Core::Client
115
115
  "account" => url_for("/accounts/#{resource_identity(environment["account"])}"),
116
116
  "alerts" => url_for("/servers/#{id}/alerts"),
117
117
  "created_at" => Time.now.to_s,
118
+ "dedicated" => !!options[:dedicated],
118
119
  "deprovisioned_at" => Time.now.to_s,
119
120
  "devices" => block_device_map,
120
121
  "enabled" => true,
@@ -42,6 +42,7 @@ class Ey::Core::Client
42
42
  "account" => url_for("/accounts/#{account}"),
43
43
  "alerts" => url_for("/servers/#{resource_id}/alerts"),
44
44
  "created_at" => Time.now.to_s,
45
+ "dedicated" => !!server["dedicated"],
45
46
  "deprovisioned_at" => nil,
46
47
  "devices" => block_device_map(server),
47
48
  "enabled" => true,
@@ -1,5 +1,5 @@
1
1
  module Ey
2
2
  module Core
3
- VERSION = "3.2.4"
3
+ VERSION = "3.2.5"
4
4
  end
5
5
  end
data/spec/servers_spec.rb CHANGED
@@ -82,6 +82,16 @@ describe 'servers' do
82
82
  }
83
83
  end
84
84
 
85
+ it "adds a dedicated app server" do
86
+ server = client.servers.create!(
87
+ :environment => environment,
88
+ :role => "app",
89
+ :flavor_id => "m3.large",
90
+ :dedicated => true,
91
+ ).resource!
92
+ expect(server.dedicated).to be_truthy
93
+ end
94
+
85
95
  it "adds an app server" do
86
96
  expect {
87
97
  client.servers.create!(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ey-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.4
4
+ version: 3.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-06 00:00:00.000000000 Z
11
+ date: 2017-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -890,4 +890,3 @@ test_files:
890
890
  - spec/tokens_spec.rb
891
891
  - spec/untracked_servers_spec.rb
892
892
  - spec/users_spec.rb
893
- has_rdoc: