View Issue Details

IDProjectCategoryView StatusLast Update
0013220CentOS-7Cloud-Imagespublic2018-01-02 11:38
Reporterfatmcgav 
PrioritynormalSeveritycrashReproducibilityalways
Status newResolutionopen 
Product Version7.2.1511 
Target VersionFixed in Version 
Summary0013220: Cloud-init: unable to use 'disk_setup' to provision machines with additional disks
DescriptionWhen attempting to use cloud-init's 'disk_setup' module to provision an Openstack instance with a 2nd volume, the cloud-init process fails with:

AttributeError: 'list' object has no attribute 'splitlines'

This error has been fixed upstream in: https://bugs.launchpad.net/cloud-init/+bug/1311463
Steps To ReproduceAttempt to use the following cloud-init script:

disk_setup:
  /dev/vdb:
    layout: true
Additional InformationThis error has been fixed upstream in: https://bugs.launchpad.net/cloud-init/+bug/1311463
TagsNo tags attached.
abrt_hash
URL

Activities

fatmcgav

fatmcgav

2017-05-04 13:14

reporter  

cloud-init_fix-splitlines.patch.txt (925 bytes)
From 0b9e0444f5092e647a3fa55887d96ffaf3d23c06 Mon Sep 17 00:00:00 2001
From: Daniel Watkins <daniel.watkins@canonical.com>
Date: Wed, 18 Mar 2015 13:33:12 +0000
Subject: [PATCH] Update is_disk_used for changed enumerate_disk output.

Fixes Launchpad bug #1311463.
---
 cloudinit/config/cc_disk_setup.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/cloudinit/config/cc_disk_setup.py b/cloudinit/config/cc_disk_setup.py
index f899210..e2ce6db 100644
--- a/cloudinit/config/cc_disk_setup.py
+++ b/cloudinit/config/cc_disk_setup.py
@@ -304,8 +304,7 @@ def is_disk_used(device):
 
     # 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:
+    if len(list(enumerate_disk(device))) > 1:
         return True
 
     # If we see a file system, then its used
fatmcgav

fatmcgav

2018-01-02 11:38

reporter   ~0030841

Now that CentOS 7.3 is using Cloud-Init 0.7.9-9, the upstream fix has been included.

However it would appear that the 'disk_setup' module is still not being included in 'cloud-init-rhel.cfg' (https://git.centos.org/blob/rpms!cloud-init.git/c7/SOURCES!cloud-init-rhel.cfg).

Is there a specific reason for this?

Issue History

Date Modified Username Field Change
2017-05-04 13:14 fatmcgav New Issue
2017-05-04 13:14 fatmcgav File Added: cloud-init_fix-splitlines.patch.txt
2018-01-02 11:38 fatmcgav Note Added: 0030841