Merge lp:~1chb1n/charms/trusty/swift-storage/next-mkfs-udev-race into lp:~openstack-charmers-archive/charms/trusty/swift-storage/next

Proposed by Ryan Beisner
Status: Work in progress
Proposed branch: lp:~1chb1n/charms/trusty/swift-storage/next-mkfs-udev-race
Merge into: lp:~openstack-charmers-archive/charms/trusty/swift-storage/next
Diff against target: 29 lines (+10/-1)
1 file modified
lib/swift_storage_utils.py (+10/-1)
To merge this branch: bzr merge lp:~1chb1n/charms/trusty/swift-storage/next-mkfs-udev-race
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+276806@code.launchpad.net

This proposal supersedes a proposal from 2015-11-05.

Description of the change

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #13159 swift-storage-next for 1chb1n mp276806
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/13159/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #12266 swift-storage-next for 1chb1n mp276806
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/12266/

Unmerged revisions

94. By Ryan Beisner on 2015-11-05

Wait for udev to settle before block operations

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/swift_storage_utils.py'
2--- lib/swift_storage_utils.py 2015-10-13 13:07:27 +0000
3+++ lib/swift_storage_utils.py 2015-11-05 18:44:33 +0000
4@@ -218,7 +218,16 @@
5 return gdevs
6
7
8+def udevadm_settle():
9+ log('Waiting for udev to settle...')
10+ cmd = ['udevadm', 'settle']
11+ check_call(cmd)
12+
13+
14 def determine_block_devices():
15+ log('Determining block devices...')
16+ udevadm_settle()
17+
18 block_device = config('block-device')
19
20 if not block_device or block_device in ['None', 'none']:
21@@ -248,7 +257,7 @@
22 for dev in determine_block_devices():
23 if config('overwrite') in ['True', 'true']:
24 clean_storage(dev)
25- # if not cleaned and in use, mkfs should fail.
26+ # if not cleaned or in use, mkfs will fail
27 mkfs_xfs(dev)
28 _dev = os.path.basename(dev)
29 _mp = os.path.join('/srv', 'node', _dev)

Subscribers

People subscribed via source and target branches