[Bug 1523921] Re: cloud-init disk_setup failure: 'list' object has no attribute 'splitlines'
Graham Leggett
minfrin at sharp.fm
Tue Dec 8 13:51:30 UTC 2015
This bug appears to be fixed in the dev branch of cloud-init:
http://bazaar.launchpad.net/~cloud-init-dev/cloud-
init/trunk/view/head:/cloudinit/config/cc_disk_setup.py
It doesn't appear to be fixed in the most recent Ubuntu supplied version
of cloud-init.
** Description changed:
When cloud-init is used to partition a disk provided by AWS on Ubuntu
v14.04, this fails.
Cloud-init is configured like this:
disk_setup:
- /dev/xvdh:
- layout: true
- overwrite: false
- table_type: 'mbr'
+ /dev/xvdh:
+ layout: true
+ overwrite: false
+ table_type: 'mbr'
This causes cloud-init to fail as follows:
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Partitioning disks: {'/dev/xvdh': {'table_type': 'mbr', 'layout': True, 'overwrite': F
+ Dec 8 13:23:33 sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Partitioning disks: {'/dev/xvdh': {'table_type': 'mbr', 'layout': True, 'overwrite': F
alse}}
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Creating new partition table/disk
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking values for /dev/xvdh definition
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking against default devices
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking if device /dev/xvdh is a valid device
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/bin/lsblk', '--pairs', '--output', 'NAME,TYPE,FSTYPE,LABEL', '/dev/xvdh', '-
+ Dec 8 13:23:33 sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Creating new partition table/disk
+ Dec 8 13:23:33 sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking values for /dev/xvdh definition
+ Dec 8 13:23:33 sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking against default devices
+ Dec 8 13:23:33 sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking if device /dev/xvdh is a valid device
+ Dec 8 13:23:33 sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/bin/lsblk', '--pairs', '--output', 'NAME,TYPE,FSTYPE,LABEL', '/dev/xvdh', '-
-nodeps'] with allowed return codes [0] (shell=False, capture=True)
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking if device layout matches
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=True)
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/blockdev', '--rereadpt', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True)
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=True)
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/sfdisk', '-l', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True)
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking if device is safe to partition
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/bin/lsblk', '--pairs', '--output', 'NAME,TYPE,FSTYPE,LABEL', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True)
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Creating partition on /dev/xvdh took 0.214 seconds
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[WARNING]: Failed partitioning operation#012'list' object has no attribute 'splitlines'
- Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Failed partitioning operation#012'list' object has no attribute 'splitlines'#012Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/cc_disk_setup.py", line 57, in handle#012 func=mkpart, args=(disk, definition))#012 File "/usr/lib/python2.7/dist-packages/cloudinit/util.py", line 1875, in log_time#012 ret = func(*args, **kwargs)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/cc_disk_setup.py", line 684, in mkpart#012 if not overwrite and (is_disk_used(device) or is_filesystem(device)):#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/cc_disk_setup.py", line 308, in is_disk_used#012 if len(use_count.splitlines()) > 1:#012AttributeError: 'list' object has no attribute 'splitlines'
+ Dec 8 13:23:33 sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking if device layout matches
+ Dec 8 13:23:33 sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=True)
+ Dec 8 13:23:33 sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/blockdev', '--rereadpt', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True)
+ Dec 8 13:23:33 sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=True)
+ Dec 8 13:23:33 sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/sfdisk', '-l', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True)
+ Dec 8 13:23:33 sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking if device is safe to partition
+ Dec 8 13:23:33 sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/bin/lsblk', '--pairs', '--output', 'NAME,TYPE,FSTYPE,LABEL', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True)
+ Dec 8 13:23:33 sql01 [CLOUDINIT] util.py[DEBUG]: Creating partition on /dev/xvdh took 0.214 seconds
+ Dec 8 13:23:33 sql01 [CLOUDINIT] util.py[WARNING]: Failed partitioning operation#012'list' object has no attribute 'splitlines'
+ Dec 8 13:23:33 sql01 [CLOUDINIT] util.py[DEBUG]: Failed partitioning operation#012'list' object has no attribute 'splitlines'#012Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/cc_disk_setup.py", line 57, in handle#012 func=mkpart, args=(disk, definition))#012 File "/usr/lib/python2.7/dist-packages/cloudinit/util.py", line 1875, in log_time#012 ret = func(*args, **kwargs)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/cc_disk_setup.py", line 684, in mkpart#012 if not overwrite and (is_disk_used(device) or is_filesystem(device)):#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/cc_disk_setup.py", line 308, in is_disk_used#012 if len(use_count.splitlines()) > 1:#012AttributeError: 'list' object has no attribute 'splitlines'
With partitioning having failed, the disk formatting that follows fails
due to the partition not existing.
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to cloud-init in Ubuntu.
https://bugs.launchpad.net/bugs/1523921
Title:
cloud-init disk_setup failure: 'list' object has no attribute
'splitlines'
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1523921/+subscriptions
More information about the Ubuntu-server-bugs
mailing list