← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1311463] [NEW] disk-setup unable to partition disks

 

Public bug reported:

The problem is with is_disk_used in cc_disk_setup.py

use_count is an array, which doesn't have a splitlines attribute.  This
is broken on ubuntu precise 12.04 with the latest updates.

def is_disk_used(device):
    """
    Check if the device is currently used. Returns true if the device
    has either a file system or a partition entry
    is no filesystem found on the disk.
    """

    # If the child count is higher 1, then there are child nodes
    # such as partition or device mapper nodes
    use_count = [x for x in enumerate_disk(device)]
    if len(use_count.splitlines()) > 1:
        return True

    # If we see a file system, then its used
    _, check_fstype, _ = check_fs(device)
    if check_fstype:
        return True

    return False

** 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/1311463

Title:
  disk-setup unable to partition disks

Status in Init scripts for use on cloud images:
  New

Bug description:
  The problem is with is_disk_used in cc_disk_setup.py

  use_count is an array, which doesn't have a splitlines attribute.
  This is broken on ubuntu precise 12.04 with the latest updates.

  def is_disk_used(device):
      """
      Check if the device is currently used. Returns true if the device
      has either a file system or a partition entry
      is no filesystem found on the disk.
      """

      # If the child count is higher 1, then there are child nodes
      # such as partition or device mapper nodes
      use_count = [x for x in enumerate_disk(device)]
      if len(use_count.splitlines()) > 1:
          return True

      # If we see a file system, then its used
      _, check_fstype, _ = check_fs(device)
      if check_fstype:
          return True

      return False

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


Follow ups

References