Skip to content

Commit

Permalink
Merge pull request #17 from PiotrProkop/fix-cloud-config
Browse files Browse the repository at this point in the history
system_installer fix cloud config partition not showing up
  • Loading branch information
jimrollenhagen authored Apr 26, 2018
2 parents 5522ff8 + 5d856f9 commit 64de209
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions ironic_lib/0011-Fix-cloud-config-partition-not-showing-up.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 0e2493445e3223fc5bf7a4a5b36cbe2fd1b449d5 Mon Sep 17 00:00:00 2001
From: PiotrProkop <[email protected]>
Date: Mon, 19 Mar 2018 11:48:06 +0100
Subject: [PATCH 11/11] Fix cloud-config partition not showing up

---
ironic_lib/disk_utils.py | 1 +
ironic_lib/tests/test_disk_utils.py | 2 ++
2 files changed, 3 insertions(+)

diff --git a/ironic_lib/disk_utils.py b/ironic_lib/disk_utils.py
index 98917f3..c6b814d 100644
--- a/ironic_lib/disk_utils.py
+++ b/ironic_lib/disk_utils.py
@@ -797,6 +797,7 @@ def create_config_drive_partition(node_uuid, device, configdrive):
LOG.debug('Waiting for the config drive partition %(part)s '
'on node %(node)s to be ready for writing.',
{'part': config_drive_part, 'node': node_uuid})
+ utils.execute('partprobe', config_drive_part.rstrip('1234567890'))
utils.execute('udevadm', 'settle',
'--exit-if-exists=%s' % config_drive_part)

diff --git a/ironic_lib/tests/test_disk_utils.py b/ironic_lib/tests/test_disk_utils.py
index a46f985..b4a3e1f 100644
--- a/ironic_lib/tests/test_disk_utils.py
+++ b/ironic_lib/tests/test_disk_utils.py
@@ -1068,6 +1068,7 @@ class WholeDiskConfigDriveTestCases(test_base.BaseTestCase):
mock_execute.assert_has_calls([
mock.call('sgdisk', '-n', '0:-64MB:0', self.dev,
run_as_root=True),
+ mock.call('partprobe', '/dev/fake'),
mock.call('udevadm', 'settle',
'--exit-if-exists=%s' % expected_part),
])
@@ -1158,6 +1159,7 @@ class WholeDiskConfigDriveTestCases(test_base.BaseTestCase):
'-0', run_as_root=True)
mock_execute.assert_has_calls([
parted_call,
+ mock.call('partprobe', expected_part.rstrip('1234567890')),
mock.call('udevadm', 'settle',
'--exit-if-exists=%s' % expected_part),
])
--
2.16.2

0 comments on commit 64de209

Please sign in to comment.