class HmcUpgrade
Attributes
_type[R]
_version[RW]
filename[RW]
hostname[RW]
interactive[RW]
mount_location[RW]
mount_options[RW]
password[RW]
reboot[RW]
remove_file[RW]
ssh_key[RW]
user[RW]
Public Class Methods
new()
click to toggle source
# File lib/HMC/Hmc_upgrade.rb, line 36 def initialize # end
Public Instance Methods
cmd()
click to toggle source
# File lib/HMC/Hmc_upgrade.rb, line 55 def cmd validate command = 'updhmc ' command += '-r ' if @reboot == true if @_type == 'server' command += "-t s -h #{@hostname} -u #{@user} -p #{@password} -f #{@filename}" elsif @_type == 'media' raise 'type media - not implemented' elsif @_type == 'local_filesystem' raise 'type local_filesystem - not implemented' end command end
validate()
click to toggle source
# File lib/HMC/Hmc_upgrade.rb, line 40 def validate if @_type.nil? @_type = 'server' unless @hostname.nil? @_type = 'server' unless @user.nil? @_type = 'server' unless @password.nil? end if @_type == 'server' raise 'hostname not setup' if @hostname.nil? raise 'user not setup' if @user.nil? raise 'password not setup' if @password.nil? end end