29 lines
532 B
Ruby
29 lines
532 B
Ruby
require "fog"
|
|
|
|
module Version2_0
|
|
module Provider
|
|
class BaseProvider
|
|
|
|
attr_accessor :ssh_key, :certificate_path, :connection_options
|
|
|
|
protected
|
|
def connection_compute options
|
|
Fog::Compute.new( options )
|
|
end
|
|
|
|
def connection_network options
|
|
Fog::Network.new( options )
|
|
end
|
|
|
|
def configured?
|
|
!(empty_param?(self.ssh_key) or empty_param?(self.certificate_path))
|
|
end
|
|
|
|
def empty_param? param
|
|
param.nil? or param.empty?
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|