Top Level Namespace

Includes:
CloudCLI

Defined Under Namespace

Modules: CloudCLI, CloudClient, DriverExecHelper, OpenNebula, Role, Service Classes: ActionManager, GenericCommand, LocalCommand, OpenNebulaDriver, RemotesCommand, SSHCommand, Sample, SampleDriver, TemplateDriver, VirtualMachineDriver

Constant Summary collapse

BIN_LOCATION =
ONE_LOCATION + '/bin'
LIB_LOCATION =
ONE_LOCATION + '/lib'
ETC_LOCATION =
ONE_LOCATION + '/etc/'
VAR_LOCATION =
ONE_LOCATION+"/var/"
CHECK_REFS =
true
ONE_LOCATION =
ENV["ONE_LOCATION"]

Instance Method Summary collapse

Methods included from CloudCLI

#cmd_name, #print_xml, #version_text

Instance Method Details

#check_item(item, target_class) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/vcenter_driver.rb', line 83

def check_item(item, target_class)
    begin
        item.name if CHECK_REFS
        if target_class
            if !item.instance_of?(target_class)
                raise "Expecting type 'RbVmomi::VIM::#{target_class}'. " \
                        "Got '#{item.class} instead."
            end
        end
    rescue RbVmomi::Fault => e
        raise "Reference \"#{item._ref}\" error [#{e.message}]. The reference does not exist"
    end
end

#check_valid(parameter, label) ⇒ Object



76
77
78
79
80
81
# File 'lib/vcenter_driver.rb', line 76

def check_valid(parameter, label)
    if parameter.nil? || parameter.empty?
        STDERR.puts error_message("The parameter '#{label}' is required for this action.")
        exit(-1)
    end
end

#error_message(message) ⇒ Object

—————————————————————————- #



68
69
70
71
72
73
74
# File 'lib/vcenter_driver.rb', line 68

def error_message(message)
    error_str = "ERROR MESSAGE --8<------\n"
    error_str << message
    error_str << "\nERROR MESSAGE ------>8--"

    error_str
end