Class: HmcUpgrade
- Inherits:
-
Object
- Object
- HmcUpgrade
- Defined in:
- lib/HMC/Hmc_upgrade.rb
Instance Attribute Summary collapse
-
#_type ⇒ Object
readonly
Returns the value of attribute _type.
-
#_version ⇒ Object
Returns the value of attribute _version.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#interactive ⇒ Object
Returns the value of attribute interactive.
-
#mount_location ⇒ Object
Returns the value of attribute mount_location.
-
#mount_options ⇒ Object
Returns the value of attribute mount_options.
-
#password ⇒ Object
Returns the value of attribute password.
-
#reboot ⇒ Object
Returns the value of attribute reboot.
-
#remove_file ⇒ Object
Returns the value of attribute remove_file.
-
#ssh_key ⇒ Object
Returns the value of attribute ssh_key.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #cmd ⇒ Object
-
#initialize ⇒ HmcUpgrade
constructor
A new instance of HmcUpgrade.
- #validate ⇒ Object
Constructor Details
#initialize ⇒ HmcUpgrade
Returns a new instance of HmcUpgrade.
36 37 38 |
# File 'lib/HMC/Hmc_upgrade.rb', line 36 def initialize # end |
Instance Attribute Details
#_type ⇒ Object (readonly)
Returns the value of attribute _type.
27 28 29 |
# File 'lib/HMC/Hmc_upgrade.rb', line 27 def _type @_type end |
#_version ⇒ Object
Returns the value of attribute _version.
25 26 27 |
# File 'lib/HMC/Hmc_upgrade.rb', line 25 def _version @_version end |
#filename ⇒ Object
Returns the value of attribute filename.
9 10 11 |
# File 'lib/HMC/Hmc_upgrade.rb', line 9 def filename @filename end |
#hostname ⇒ Object
Returns the value of attribute hostname.
3 4 5 |
# File 'lib/HMC/Hmc_upgrade.rb', line 3 def hostname @hostname end |
#interactive ⇒ Object
Returns the value of attribute interactive.
12 13 14 |
# File 'lib/HMC/Hmc_upgrade.rb', line 12 def interactive @interactive end |
#mount_location ⇒ Object
Returns the value of attribute mount_location.
7 8 9 |
# File 'lib/HMC/Hmc_upgrade.rb', line 7 def mount_location @mount_location end |
#mount_options ⇒ Object
Returns the value of attribute mount_options.
8 9 10 |
# File 'lib/HMC/Hmc_upgrade.rb', line 8 def end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/HMC/Hmc_upgrade.rb', line 5 def password @password end |
#reboot ⇒ Object
Returns the value of attribute reboot.
10 11 12 |
# File 'lib/HMC/Hmc_upgrade.rb', line 10 def reboot @reboot end |
#remove_file ⇒ Object
Returns the value of attribute remove_file.
11 12 13 |
# File 'lib/HMC/Hmc_upgrade.rb', line 11 def remove_file @remove_file end |
#ssh_key ⇒ Object
Returns the value of attribute ssh_key.
6 7 8 |
# File 'lib/HMC/Hmc_upgrade.rb', line 6 def ssh_key @ssh_key end |
#user ⇒ Object
Returns the value of attribute user.
4 5 6 |
# File 'lib/HMC/Hmc_upgrade.rb', line 4 def user @user end |
Instance Method Details
#cmd ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# 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 ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# 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 |