← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1749980] [NEW] ds-identify doesn't properly detect ISO

 

Public bug reported:

I have a proper ISO image mounted for my virtual machine but still 'ds-
identify' doesn't properly detect OVF datasource in my virtual machine.
On further investigation, found a minor issue with 'read_fs_info()'
function in ds-identify.

#################################################
In read_fs_info()

    out=$(blkid -c /dev/null -o export) || {
        ret=$?
        error "failed running [$ret]: blkid -c /dev/null -o export"
        DI_FS_LABELS="$UNAVAILABLE:error"
        DI_ISO9660_DEVS="$UNAVAILABLE:error"
        return $ret
    }
    IFS="$CR"
    set -- $out
    IFS="$oifs"
    for line in "$@" ""; do
        case "${line}" in
            DEVNAME=*) dev=${line#DEVNAME=};;
            LABEL=*) label="${line#LABEL=}";
                     labels="${labels}${line#LABEL=}${delim}";;
            TYPE=*) ftype=${line#TYPE=};;
            "") if [ "$ftype" = "iso9660" ]; then
                    isodevs="${isodevs} ${dev}=$label"
                fi
                ftype=""; devname=""; label="";
        esac
    done

This function parses the output for blkid and then sets the 'isodevs' _only_ when there is an entry other than DEVNAME, UUID, LABEL, TYPE for iso9660 entries. This is not quite right. In my test environment, (as seen below), the other entry PARTUUID, etc was not present.
#################################################

Inside the virtual machine:

$ sudo blkid -c /dev/null -o export

DEVNAME=/dev/sr0
UUID=2009-04-20-15-30-24-00
LABEL=OVF\ Customization
TYPE=iso9660

DEVNAME=/dev/sda1
UUID=2f09aea2-6411-444e-9d5b-32c0aa25c067
TYPE=ext4
PARTUUID=70ae1e13-01

In the blkid command output, for the ISO that I have mounted, only
DEVNAME, UUID, LABEL and TYPE entries were present. No other entry was
present. If there was another entry like PARTUUID, ds-identify would
have properly detected the OVF datasource.

Logging a bug to fix read_fs_info to properly parse the output of blkid.

Please let me know if any other information is required.

Thanks
Sankar.

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1749980

Title:
  ds-identify doesn't properly detect ISO

Status in cloud-init:
  New

Bug description:
  I have a proper ISO image mounted for my virtual machine but still
  'ds-identify' doesn't properly detect OVF datasource in my virtual
  machine. On further investigation, found a minor issue with
  'read_fs_info()' function in ds-identify.

  #################################################
  In read_fs_info()

      out=$(blkid -c /dev/null -o export) || {
          ret=$?
          error "failed running [$ret]: blkid -c /dev/null -o export"
          DI_FS_LABELS="$UNAVAILABLE:error"
          DI_ISO9660_DEVS="$UNAVAILABLE:error"
          return $ret
      }
      IFS="$CR"
      set -- $out
      IFS="$oifs"
      for line in "$@" ""; do
          case "${line}" in
              DEVNAME=*) dev=${line#DEVNAME=};;
              LABEL=*) label="${line#LABEL=}";
                       labels="${labels}${line#LABEL=}${delim}";;
              TYPE=*) ftype=${line#TYPE=};;
              "") if [ "$ftype" = "iso9660" ]; then
                      isodevs="${isodevs} ${dev}=$label"
                  fi
                  ftype=""; devname=""; label="";
          esac
      done

  This function parses the output for blkid and then sets the 'isodevs' _only_ when there is an entry other than DEVNAME, UUID, LABEL, TYPE for iso9660 entries. This is not quite right. In my test environment, (as seen below), the other entry PARTUUID, etc was not present.
  #################################################

  Inside the virtual machine:

  $ sudo blkid -c /dev/null -o export

  DEVNAME=/dev/sr0
  UUID=2009-04-20-15-30-24-00
  LABEL=OVF\ Customization
  TYPE=iso9660

  DEVNAME=/dev/sda1
  UUID=2f09aea2-6411-444e-9d5b-32c0aa25c067
  TYPE=ext4
  PARTUUID=70ae1e13-01

  In the blkid command output, for the ISO that I have mounted, only
  DEVNAME, UUID, LABEL and TYPE entries were present. No other entry was
  present. If there was another entry like PARTUUID, ds-identify would
  have properly detected the OVF datasource.

  Logging a bug to fix read_fs_info to properly parse the output of
  blkid.

  Please let me know if any other information is required.

  Thanks
  Sankar.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1749980/+subscriptions


Follow ups