← Back to team overview

curtin-dev team mailing list archive

[Bug 1899699] [NEW] udevadm_info() fails if any value contains "="

 

Public bug reported:

Description:
  curtin.udev.udevadm_info() uses split("=", 2), but intended to use split("=", 1).

  This was observed while attempting to install Ubuntu 20.04 on Nutanix
AHV.

Example:
  ubuntu-server@ubuntu-server:~$ sudo udevadm info --export --query=property /dev/sda | grep '=.*='
  SCSI_IDENT_TARGET_VENDOR='clusterid=58296284039924012'
  ubuntu-server@ubuntu-server:~$ export PYTHONPATH=/snap/subiquity/1966/lib/python3.6/site-packages
  ubuntu-server@ubuntu-server:~$ /snap/subiquity/1966/usr/bin/python3
  Python 3.6.9 (default, Jul 17 2020, 12:50:27)
  [GCC 8.4.0] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> from curtin.udev import udevadm_info
  >>> udevadm_info("/dev/sda")
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/snap/subiquity/1966/lib/python3.6/site-packages/curtin/udev.py", line 95, in udevadm_info
      key, value = line.split('=', 2)
  ValueError: too many values to unpack (expected 2)

** Affects: curtin
     Importance: Undecided
         Status: New

** Patch added: "udevadm_info.patch"
   https://bugs.launchpad.net/bugs/1899699/+attachment/5421870/+files/udevadm_info.patch

-- 
You received this bug notification because you are a member of curtin
developers, which is subscribed to curtin.
https://bugs.launchpad.net/bugs/1899699

Title:
  udevadm_info() fails if any value contains "="

Status in curtin:
  New

Bug description:
  Description:
    curtin.udev.udevadm_info() uses split("=", 2), but intended to use split("=", 1).

    This was observed while attempting to install Ubuntu 20.04 on
  Nutanix AHV.

  Example:
    ubuntu-server@ubuntu-server:~$ sudo udevadm info --export --query=property /dev/sda | grep '=.*='
    SCSI_IDENT_TARGET_VENDOR='clusterid=58296284039924012'
    ubuntu-server@ubuntu-server:~$ export PYTHONPATH=/snap/subiquity/1966/lib/python3.6/site-packages
    ubuntu-server@ubuntu-server:~$ /snap/subiquity/1966/usr/bin/python3
    Python 3.6.9 (default, Jul 17 2020, 12:50:27)
    [GCC 8.4.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from curtin.udev import udevadm_info
    >>> udevadm_info("/dev/sda")
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/snap/subiquity/1966/lib/python3.6/site-packages/curtin/udev.py", line 95, in udevadm_info
        key, value = line.split('=', 2)
    ValueError: too many values to unpack (expected 2)

To manage notifications about this bug go to:
https://bugs.launchpad.net/curtin/+bug/1899699/+subscriptions