Merge branch 'features' into qa
This commit is contained in:
commit
31a691cfaa
@ -423,6 +423,7 @@ module Provider
|
|||||||
|
|
||||||
# When you create an instance with with ephemeral storages available within AWS console,
|
# When you create an instance with with ephemeral storages available within AWS console,
|
||||||
# they are mapped automatically. But in case of creating within API we should map them manually.
|
# they are mapped automatically. But in case of creating within API we should map them manually.
|
||||||
|
# Result example: [{'VirtualName' => 'ephemeral0', 'DeviceName' => '/dev/xvdb'}]
|
||||||
def ephemeral_storages_mappings(flavor)
|
def ephemeral_storages_mappings(flavor)
|
||||||
require 'fog/aws/models/compute/flavors'
|
require 'fog/aws/models/compute/flavors'
|
||||||
details = Fog::Compute::AWS::FLAVORS.detect {|f| f[:id] == flavor}
|
details = Fog::Compute::AWS::FLAVORS.detect {|f| f[:id] == flavor}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ module Provider
|
|||||||
|
|
||||||
def initialize config
|
def initialize config
|
||||||
self.certificate_path = config[:static_certificate]
|
self.certificate_path = config[:static_certificate]
|
||||||
self.ssh_key = "static"
|
self.ssh_key = config[:static_ssh_key] || "static"
|
||||||
@@mongo ||= MongoConnector.new(config[:mongo_db], config[:mongo_host], config[:mongo_port], config[:mongo_user], config[:mongo_password])
|
@@mongo ||= MongoConnector.new(config[:mongo_db], config[:mongo_host], config[:mongo_port], config[:mongo_user], config[:mongo_password])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -2,5 +2,34 @@ require_relative "accounts_factory"
|
|||||||
module Provider
|
module Provider
|
||||||
class StaticAccountsFactory < AccountsFactory
|
class StaticAccountsFactory < AccountsFactory
|
||||||
|
|
||||||
|
def init config
|
||||||
|
@connections = {}
|
||||||
|
accounts.each do |account|
|
||||||
|
create_connection_from_account(config, account)
|
||||||
|
puts "\tFound static account '#{account.account_name}'"
|
||||||
|
end
|
||||||
|
ProviderFactory.add_provider Static::PROVIDER unless @connections.empty?
|
||||||
|
end
|
||||||
|
|
||||||
|
def provider_name
|
||||||
|
Static::PROVIDER
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_connection_from_account config, account
|
||||||
|
options = {
|
||||||
|
static_ssh_key: account.ssh_key,
|
||||||
|
mongo_db: config[:mongo_db],
|
||||||
|
mongo_host: config[:mongo_host],
|
||||||
|
mongo_port: config[:mongo_port],
|
||||||
|
mongo_user: config[:mongo_user],
|
||||||
|
mongo_password: config[:mongo_password]
|
||||||
|
}
|
||||||
|
add_connection(account.account_name, Static.new(options))
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_account hash
|
||||||
|
Devops::Model::StaticProviderAccount.new(hash)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user