Module: Pec

Defined in:
lib/pec.rb,
lib/pec/cli.rb,
lib/pec/init.rb,
lib/pec/logger.rb,
lib/pec/sample.rb,
lib/pec/handler.rb,
lib/pec/version.rb,
lib/pec/director.rb,
lib/pec/configure.rb

Defined Under Namespace

Modules: Handler Classes: CLI, Configure, Director, Init, Logger

Constant Summary collapse

VERSION =
"0.5.2"

Class Method Summary collapse

Class Method Details

.compute ⇒ Object



14
15
16
17
18
19
# File 'lib/pec.rb', line 14

def self.compute
  @_compute ||= Fog::Compute.new({
    provider: 'openstack'
  })
  @_compute
end

.configure ⇒ Object



43
44
45
46
# File 'lib/pec.rb', line 43

def self.configure
  load_config unless @_configure
  @_configure
end

.identity ⇒ Object



28
29
30
31
32
33
# File 'lib/pec.rb', line 28

def self.identity
  @_identity ||= Fog::Identity.new({
    provider: 'openstack'
  })
  @_identity
end

.load_config(file_name = nil) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/pec.rb', line 35

def self.load_config(file_name=nil)
  file_name ||= 'Pec.yaml'
  @_configure = []
  YAML.load_file(file_name).to_hash.reject {|c| c[0].to_s.match(/^_/)}.each do |host|
    @_configure << Pec::Configure.new(host)
  end
end

.neutron ⇒ Object



21
22
23
24
25
26
# File 'lib/pec.rb', line 21

def self.neutron
  @_neutron ||= Fog::Network.new({
    provider: 'openstack'
  })
  @_neutron
end