csc/Hanlon — pull request #190 by jcpowermac (2014-10-03 21:10:42+00:00)
Title: Issue #189 ESXi 6.0 fixes

Fixes issue #189

While debugging I received this error `invalid byte sequence in UTF-8`. Performed search and located this [article](http://stackoverflow.com/questions/18307686/file-readlines-invalid-byte-sequence-in-utf-8-argumenterror) for possible fix.

With my debugging `puts` I get this result after the change...
```
[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/3659J9hU3S3VoiSqnc0V2C
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 => 3659J9hU3S3VoiSqnc0V2C
Type => VMware Hypervisor Install
ISO Filename => VMware-VMvisor-Installer-6.0.0-2159203.x86_64.iso
Path => /opt/hanlon/image/esxi/3659J9hU3S3VoiSqnc0V2C
Status => Valid
Version => VMware ESXi 6.0 RC
```
Which slows that the `@esxi_version` and the `@boot_cfg` are being populated.

To confirm that this change did not affect earlier version of ESXi I downloaded an added the following (again with debugging `puts`):

ESXi 5.5
```
[jcallen@virhanpaw001t Hanlon]$ ./cli/hanlon image add -t esxi -p /opt/hanlon/VMware-ESXi-5.5U1-Rollup_2ISO.iso
Attempting to add, please wait...
Image Added:
before if
image_path: /opt/hanlon/image/esxi/4sG7v60DnrmmTmsa3l16NI
vmware-esx-base-osl.txt_exist: true
boot_cfg: true
boot_cfg: bootstate=0
title=Loading ESXi installer
kernel=/tboot.b00
kernelopt=runweasel
modules=/b.b00 --- /jumpstrt.gz --- /useropts.gz --- /k.b00 --- /chardevs.b00 --- /a.b00 --- /user.b00 --- /scsi-aac.v00 --- /scsi-adp.v00 --- /misc-cni.v00 --- /net-bnx2.v00 --- /net-bnx2.v01 --- /net-cnic.v00 --- /net-tg3.v00 --- /scsi-bnx.v00 --- /scsi-bnx.v01 --- /net-bna.v00 --- /net-enic.v00 --- /elxnet.v00 --- /ima-be2i.v00 --- /lpfc.v00 --- /scsi-be2.v00 --- /scsi-iom.v00 --- /scsi-hps.v00 --- /scsi-hfc.v00 --- /net-ixgb.v00 --- /scsi-meg.v00 --- /scsi-meg.v01 --- /scsi-mpt.v00 --- /scsi-mpt.v01 --- /mtip32xx.v00 --- /net-mlx4.v00 --- /net-nx-n.v00 --- /net-qlcn.v00 --- /qlnative.v00 --- /net-sfc.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 --- /s.v00 --- /sb.v00 --- /weaselin.t00 --- /esx-dvfi.v00 --- /xlibs.v00 --- /ima-qla4.v00 --- /ipmi-ipm.v00 --- /ipmi-ipm.v01 --- /ipmi-ipm.v02 --- /lsi-mr3.v00 --- /lsi-msgp.v00 --- /misc-dri.v00 --- /net-be2n.v00 --- /net-e100.v00 --- /net-e100.v01 --- /net-forc.v00 --- /net-igb.v00 --- /net-mlx4.v01 --- /net-qlge.v00 --- /net-vmxn.v00 --- /ohci-usb.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-adp.v01 --- /scsi-aic.v00 --- /scsi-ips.v00 --- /scsi-lpf.v00 --- /scsi-meg.v02 --- /scsi-meg.v03 --- /scsi-mpt.v02 --- /scsi-mpt.v03 --- /scsi-qla.v00 --- /scsi-qla.v01 --- /uhci-usb.v00 --- /tools.t00 --- /sas-vgc.v00 --- /scsi-fni.v00 --- /xorg.v00 --- /imgdb.tgz --- /imgpayld.tgz
build=
updated=0
esxi_version: VMware ESXi 5.5.0u1 GA
in if, so they actualy exist
UUID => 4sG7v60DnrmmTmsa3l16NI
Type => VMware Hypervisor Install
ISO Filename => VMware-ESXi-5.5U1-Rollup_2ISO.iso
Path => /opt/hanlon/image/esxi/4sG7v60DnrmmTmsa3l16NI
Status => Valid
Version => VMware ESXi 5.5.0u1 GA
```
ESXi 5.1
```
[jcallen@virhanpaw001t Hanlon]$ ./cli/hanlon image add -t esxi -p /opt/hanlon/VMware-VMvisor-Installer-5.1.0.update02-1483097.x86_64.iso
Attempting to add, please wait...
Image Added:
before if
image_path: /opt/hanlon/image/esxi/2BC1nWtgLVf2rSc0NjMyGq
vmware-esx-base-osl.txt_exist: true
boot_cfg: true
boot_cfg: bootstate=0
title=Loading ESXi installer
kernel=/tboot.b00
kernelopt=runweasel
modules=/b.b00 --- /useropts.gz --- /k.b00 --- /chardevs.b00 --- /a.b00 --- /user.b00 --- /s.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 --- /weaselin.t00 --- /esx_dvfi.v00 --- /xlibs.v00 --- /ima_qla4.v00 --- /ipmi_ipm.v00 --- /ipmi_ipm.v01 --- /ipmi_ipm.v02 --- /misc_cni.v00 --- /misc_dri.v00 --- /net_be2n.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_nx_n.v00 --- /net_r816.v00 --- /net_r816.v01 --- /net_s2io.v00 --- /net_sky2.v00 --- /net_tg3.v00 --- /net_vmxn.v00 --- /ohci_usb.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_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 --- /scsi_rst.v00 --- /uhci_usb.v00 --- /tools.t00 --- /xorg.v00 --- /imgdb.tgz --- /imgpayld.tgz
build=
updated=0
esxi_version: VMware ESXi 5.1.0u2 GA
in if, so they actualy exist
UUID => 2BC1nWtgLVf2rSc0NjMyGq
Type => VMware Hypervisor Install
ISO Filename => VMware-VMvisor-Installer-5.1.0.update02-1483097.x86_64.iso
Path => /opt/hanlon/image/esxi/2BC1nWtgLVf2rSc0NjMyGq
Status => Valid
Version => VMware ESXi 5.1.0u2 GA
```
And finally ESXi 5.0
```
[jcallen@virhanpaw001t Hanlon]$ ./cli/hanlon image add -t esxi -p /opt/hanlon/VMware-VMvisor-Installer-5.0.0.update03-1311175.x86_64.iso
Attempting to add, please wait...
Image Added:
before if
image_path: /opt/hanlon/image/esxi/2ca4hwKlNisqI3yk43ssvU
vmware-esx-base-osl.txt_exist: true
boot_cfg: true
boot_cfg: bootstate=0
title=Loading ESXi installer
kernel=/tboot.b00
kernelopt=runweasel
modules=/b.b00 --- /useropts.gz --- /k.b00 --- /a.b00 --- /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 --- /s.v00 --- /weaselin.i00 --- /ima-qla4.v00 --- /ipmi-ipm.v00 --- /ipmi-ipm.v01 --- /ipmi-ipm.v02 --- /misc-cni.v00 --- /misc-dri.v00 --- /net-be2n.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-nx-n.v00 --- /net-r816.v00 --- /net-r816.v01 --- /net-s2io.v00 --- /net-sky2.v00 --- /net-tg3.v00 --- /ohci-usb.v00 --- /sata-ahc.v00 --- /sata-ata.v00 --- /sata-sat.v00 --- /sata-sat.v01 --- /sata-sat.v02 --- /sata-sat.v03 --- /scsi-aac.v00 --- /scsi-adp.v00 --- /scsi-aic.v00 --- /scsi-bnx.v00 --- /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 --- /scsi-rst.v00 --- /uhci-usb.v00 --- /tools.t00 --- /imgdb.tgz --- /imgpayld.tgz
build=
updated=0
esxi_version: VMware ESXi 5.0.0 U3 GA
in if, so they actualy exist
UUID => 2ca4hwKlNisqI3yk43ssvU
Type => VMware Hypervisor Install
ISO Filename => VMware-VMvisor-Installer-5.0.0.update03-1311175.x86_64.iso
Path => /opt/hanlon/image/esxi/2ca4hwKlNisqI3yk43ssvU
Status => Valid
Version => VMware ESXi 5.0.0 U3 GA

```