Top Level Namespace

Includes:
CloudCLI

Defined Under Namespace

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

Constant Summary collapse

BIN_LOCATION =
ONE_LOCATION + '/bin'
LIB_LOCATION =
ONE_LOCATION + '/lib'
ETC_LOCATION =
ONE_LOCATION + '/etc/'
VAR_LOCATION =
ONE_LOCATION+"/var/"
GEMS_LOCATION =
ONE_LOCATION + '/share/gems'
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



130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/vcenter_driver.rb', line 130

def check_item(item, target_class)
    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

#check_valid(parameter, label) ⇒ Object



122
123
124
125
126
127
128
# File 'lib/vcenter_driver.rb', line 122

def check_valid(parameter, label)
    return unless parameter.nil? || parameter.empty?

    STDERR.puts error_message("The parameter '#{label}'\
                               is required for this action.")
    exit(-1)
end

#error_message(message) ⇒ Object

—————————————————————————- # Helper functions # —————————————————————————- #



114
115
116
117
118
119
120
# File 'lib/vcenter_driver.rb', line 114

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

    error_str
end