csc/Hanlon — pull request #193 by jcpowermac (2014-10-06 19:47:22+00:00)
Title: Fixes issue #192, vmware_hypervisor implicit return

This pull request is for issue #192. The only change is removing line#60. Testing results as follows.

Purposely removed fix for ESXi 6.0 (encoding) and line 60 `[true,'']` still exists.
```
Puma starting in single mode...
* Version 2.9.1 (ruby 1.9.3-p547), codename: Team High Five
* Min threads: 0, max threads: 16
* Environment: development
>> Starting new thread to remove inactive nodes; cycle time => 30, timeout => 300
>> Starting new thread to print status of Hanlon-related jobs...
>> At 2014-10-06 15:27:19 -0400; All jobs running => [every_1412623639.548581_1618926898379788300, every_1412623639.5489173_1331298069282805702]
* Listening on tcp://0.0.0.0:8080
Use Ctrl-C to stop
sudo: a password is required
>>>>> in base.rb add_image
before if
image_path: /opt/hanlon/image/esxi/5fUV5wI4eb7SWlcp4ZYJ2S
vmware-esx-base-osl.txt_exist: true
boot_cfg: true
invalid byte sequence in UTF-8
success: true
10.53.252.253 - - [06/Oct/2014 15:27:27] "POST /hanlon/v1/image HTTP/1.1" 201 534 1.6198
```
From the puma output you can see that the value returned from the verify method was true which is incorrect.

And the image added which should not have happened.
```
[jcallen@virhanpaw001t Hanlon]$ ./cli/hanlon image add -t esxi -p /opt/hanlon/VMware-VMvisor-Installer-6.0.0-2159203.x86_64.iso
Attempting to add, please wait...
Image Added:
before if
image_path: /opt/hanlon/image/esxi/5fUV5wI4eb7SWlcp4ZYJ2S
vmware-esx-base-osl.txt_exist: true
boot_cfg: true
invalid byte sequence in UTF-8
UUID => 5fUV5wI4eb7SWlcp4ZYJ2S
Type => VMware Hypervisor Install
ISO Filename => VMware-VMvisor-Installer-6.0.0-2159203.x86_64.iso
Path => /opt/hanlon/image/esxi/5fUV5wI4eb7SWlcp4ZYJ2S
Status => Valid
Version =>
```

Purposely removed fix for ESXi 6.0 (encoding) and removed line 60 `[true,'']`, this is the proper response the image fails to add.
```
[jcallen@virhanpaw001t Hanlon]$ !1201
./cli/hanlon image add -t esxi -p /opt/hanlon/VMware-VMvisor-Installer-6.0.0-2159203.x86_64.iso
Attempting to add, please wait...
[image] [add_image] <-invalid byte sequence in UTF-8

Command help:
hanlon image add (options...)
-t, --type TYPE The type of image (mk, os, esxi, or xenserver)
-p, --path /path/to/iso The local path to the image ISO
-n, --name IMAGE_NAME The logical name to use (os images only)
-v, --version VERSION The version to use (os images only)
-h, --help Display this screen.
```

Encoding re-enabled and `[true,'']` removed, image adds as expected.
```
[jcallen@virhanpaw001t Hanlon]$ ./cli/hanlon image add -t esxi -p /opt/hanlon/VMware-VMvisor-Installer-6.0.0-2159203.x86_64.iso
Attempting to add, please wait...
Image Added:
before if
image_path: /opt/hanlon/image/esxi/gTfPPzPznnhnTdDTnlXXA
vmware-esx-base-osl.txt_exist: true
boot_cfg: true
boot_cfg: bootstate=0
title=Loading ESXi installer
timeout=5
kernel=/tboot.b00
kernelopt=runweasel
modules=/b.b00 --- /jumpstrt.gz --- /useropts.gz --- /k.b00 --- /chardevs.b00 --- /a.b00 --- /user.b00 --- /uc_intel.b00 --- /uc_amd.b00 --- /sb.v00 --- /s.v00 --- /mtip32xx.v00 --- /ata_pata.v00 --- /ata_pata.v01 --- /ata_pata.v02 --- /ata_pata.v03 --- /ata_pata.v04 --- /ata_pata.v05 --- /ata_pata.v06 --- /ata_pata.v07 --- /block_cc.v00 --- /ehci_ehc.v00 --- /elxnet.v00 --- /emulex_e.v00 --- /weaselin.t00 --- /esx_dvfi.v00 --- /ima_qla4.v00 --- /ipmi_ipm.v00 --- /ipmi_ipm.v01 --- /ipmi_ipm.v02 --- /lpfc.v00 --- /lsi_mr3.v00 --- /lsi_msgp.v00 --- /misc_cni.v00 --- /misc_dri.v00 --- /net_bnx2.v00 --- /net_bnx2.v01 --- /net_cnic.v00 --- /net_e100.v00 --- /net_e100.v01 --- /net_enic.v00 --- /net_forc.v00 --- /net_igb.v00 --- /net_ixgb.v00 --- /net_ixgb.v01 --- /net_mlx4.v00 --- /net_mlx4.v01 --- /net_nx_n.v00 --- /net_tg3.v00 --- /net_vmxn.v00 --- /nmlx4_co.v00 --- /nmlx4_en.v00 --- /nmlx4_rd.v00 --- /nvme.v00 --- /ohci_usb.v00 --- /qlnative.v00 --- /rste.v00 --- /sata_ahc.v00 --- /sata_ata.v00 --- /sata_sat.v00 --- /sata_sat.v01 --- /sata_sat.v02 --- /sata_sat.v03 --- /sata_sat.v04 --- /scsi_aac.v00 --- /scsi_adp.v00 --- /scsi_aic.v00 --- /scsi_bnx.v00 --- /scsi_bnx.v01 --- /scsi_fni.v00 --- /scsi_hps.v00 --- /scsi_ips.v00 --- /scsi_lpf.v00 --- /scsi_meg.v00 --- /scsi_meg.v01 --- /scsi_meg.v02 --- /scsi_mpt.v00 --- /scsi_mpt.v01 --- /scsi_mpt.v02 --- /scsi_qla.v00 --- /scsi_qla.v01 --- /uhci_usb.v00 --- /xhci_xhc.v00 --- /tools.t00 --- /xorg.v00 --- /imgdb.tgz --- /imgpayld.tgz
build=
updated=0
esxi_version: VMware ESXi 6.0 RC
in if, so they actualy exist
UUID => gTfPPzPznnhnTdDTnlXXA
Type => VMware Hypervisor Install
ISO Filename => VMware-VMvisor-Installer-6.0.0-2159203.x86_64.iso
Path => /opt/hanlon/image/esxi/gTfPPzPznnhnTdDTnlXXA
Status => Valid
Version => VMware ESXi 6.0 RC
```