Module: Gogetit

Defined in:
lib/executionhooks.rb,
lib/gogetit.rb,
lib/gogetit/cli.rb,
lib/gogetit/maas.rb,
lib/gogetit/util.rb,
lib/providers/lxd.rb,
lib/gogetit/config.rb,
lib/gogetit/version.rb,
lib/providers/libvirt.rb,
lib/gogetit/multilogger.rb

Overview

Defined Under Namespace

Modules: Config, ExecutionHooks, Util Classes: CLI, GogetLXD, GogetLibvirt, GogetMAAS, MultiLogger

Constant Summary collapse

VERSION =
"0.10.0"
@@result =
nil

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject (readonly)

Returns the value of attribute config.



10
11
12
# File 'lib/gogetit.rb', line 10

def config
  @config
end

.libvirtObject (readonly)

Returns the value of attribute libvirt.



10
11
12
# File 'lib/gogetit.rb', line 10

def libvirt
  @libvirt
end

.loggerObject (readonly)

Returns the value of attribute logger.



10
11
12
# File 'lib/gogetit.rb', line 10

def logger
  @logger
end

.lxdObject (readonly)

Returns the value of attribute lxd.



10
11
12
# File 'lib/gogetit.rb', line 10

def lxd
  @lxd
end

.maasObject (readonly)

Returns the value of attribute maas.



10
11
12
# File 'lib/gogetit.rb', line 10

def maas
  @maas
end

Class Method Details

.get_provider_of(name) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gogetit.rb', line 19

def self.get_provider_of(name)
  if lxd.container_exists?(name)
    logger.info("Calling <#{__method__.to_s}>, It is a LXD container.")
    return 'lxd'
  elsif libvirt.domain_exists?(name)
    logger.info("Calling <#{__method__.to_s}>, It is a KVM domain.")
    return 'libvirt'
  else
    puts "#{name} is not found"
    return nil
  end
end

.get_resultObject



13
14
15
# File 'lib/gogetit/cli.rb', line 13

def self.get_result
  @@result
end

.set_result(x) ⇒ Object



9
10
11
# File 'lib/gogetit/cli.rb', line 9

def self.set_result(x)
  @@result = x
end