← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1598310] Re: Curtin block.get_blockdev_sector_size incorrectly assumes block._lsblock will return a dictionary with only a single entry

 

This bug was fixed in the package curtin - 0.1.0~bzr425-0ubuntu1~16.04.1

---------------
curtin (0.1.0~bzr425-0ubuntu1~16.04.1) xenial-proposed; urgency=medium

  [ Scott Moser ]
  * debian/new-upstream-snapshot: add writing of debian changelog entries.

  [ Ryan Harper ]
  * New upstream snapshot.
    - unittest,tox.ini: catch and fix issue with trusty-level mock of open
    - block/mdadm: add option to ignore mdadm_assemble errors  (LP: #1618429)
    - curtin/doc: overhaul curtin documentation for readthedocs.org
      (LP: #1351085)
    - curtin.util: re-add support for RunInChroot  (LP: #1617375)
    - curtin/net: overhaul of eni rendering to handle mixed ipv4/ipv6 configs
    - curtin.block: refactor clear_holders logic into block.clear_holders and
      cli cmd
    - curtin.apply_net should exit non-zero upon exception.  (LP: #1615780)
    - apt: fix bug in disable_suites if sources.list line is blank.
    - vmtests: disable Wily in vmtests
    - Fix the unittests for test_apt_source.
    - get CURTIN_VMTEST_PARALLEL shown correctly in jenkins-runner output
    - fix vmtest check_file_strippedline to strip lines before comparing
    - fix whitespace damage in tests/vmtests/__init__.py
    - fix dpkg-reconfigure when debconf_selections was provided.
      (LP: #1609614)
    - fix apt tests on non-intel arch
    - Add apt features to curtin.  (LP: #1574113)
    - vmtest: easier use of parallel and controlling timeouts
    - mkfs.vfat: add force flag for formating whole disks  (LP: #1597923)
    - block.mkfs: fix sectorsize flag  (LP: #1597522)
    - block_meta: cleanup use of sys_block_path and handle cciss knames
      (LP: #1562249)
    - block.get_blockdev_sector_size: handle _lsblock multi result return
      (LP: #1598310)
    - util: add target (chroot) support to subp, add target_path helper.
    - block_meta: fallback to parted if blkid does not produce output
      (LP: #1524031)
    - commands.block_wipe:  correct default wipe mode to 'superblock'
    - tox.ini: run coverage normally rather than separately
    - move uefi boot knowledge from launch and vmtest to xkvm

 -- Ryan Harper <ryan.harper@xxxxxxxxxxxxx>  Mon, 03 Oct 2016 13:43:54
-0500

** Changed in: curtin (Ubuntu Xenial)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1598310

Title:
  Curtin block.get_blockdev_sector_size incorrectly assumes
  block._lsblock will return a dictionary with only a single entry

Status in curtin:
  Fix Committed
Status in curtin package in Ubuntu:
  Fix Released
Status in curtin source package in Xenial:
  Fix Released

Bug description:
  [Impact]

   * Curtin block module method `get_blockdev_sector_size` fails when
     pointed at a device with multiple partitions instead of only 
     a partition.
     
     Curtin has been updated to filter the results to find the expected
     device path and return results for that device.
     
  [Test Case]

   * Install proposed curtin package on a system with a block device with
     multiple partitions.
     - python3 -c 'from curtin import block;
                   block.get_blockdev_sector_size("/dev/sda")'

    PASS: method call returns tuple with values
     - (512, 512)

    FAIL: method call fails with stacktrace like
     - Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "curtin/curtin/block/__init__.py", line 426,
      in get_blockdev_sector_size
       [parent] = info
     ValueError: too many values to unpack (expected 1)

  [Regression Potential]

   * Third-party consumers of curtin modules may have relied on this failure
     to detect devices which contained partitions.


  [Original Description]
  The function curtin.get_blockdev_sector_size will not work when called with a devpath which lsblk will return multiple lines of results for.

  This means that in some cases formatting a device other than a
  partition may fail, because block.mkfs checks for logical block size
  using this function.

  For example:
  Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
  [GCC 5.3.1 20160330] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> from curtin import block
  >>> block.get_blockdev_sector_size('/dev/sda1')
  (512, 512)
  >>> block.get_blockdev_sector_size('/dev/sda5')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/magicanus/code/curtin-clean/curtin/curtin/block/__init__.py", line 426, in get_blockdev_sector_size
      [parent] = info
  ValueError: too many values to unpack (expected 1)
  >>> block.get_blockdev_sector_size('/dev/sda')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/magicanus/code/curtin-clean/curtin/curtin/block/__init__.py", line 426, in get_blockdev_sector_size
      [parent] = info
  ValueError: too many values to unpack (expected 1)

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