summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandon Van Ness <sandon@inktank.com>2013-07-10 14:55:52 -0700
committerSandon Van Ness <sandon@inktank.com>2013-07-10 15:06:25 -0700
commit180c7b4567dc7fa1648806646b9d44c9dcc6d039 (patch)
tree585a452d43fd436f560b3a184682e483809b0eea
parent348acecb8de1b2602811bc51b937b8c1858a0484 (diff)
downloadceph-180c7b4567dc7fa1648806646b9d44c9dcc6d039.tar.gz
Get device-by-path by looking for it instead of assuming 3rd entry.
On some systems (virtual machines so far) the device-by-path entry from udevadm is not always in the same spot so instead actually look for the right output instead of blindy assuming that its a specific field in the output. Signed-off-by: Sandon Van Ness <sandon@inktank.com> Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
-rwxr-xr-xsrc/ceph-disk8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ceph-disk b/src/ceph-disk
index 39fcc4216da..35e4592ec4d 100755
--- a/src/ceph-disk
+++ b/src/ceph-disk
@@ -857,7 +857,13 @@ def prepare_journal_dev(
'--name={name}'.format(name=os.path.basename(journal)),
],
)
- journal_symlink = '/dev/{symlink}-part{num}'.format(symlink=str(symlinks).split()[2], num=num)
+ journal_symlink = None
+ for udev_line in symlinks.split():
+ if 'by-path' in udev_line:
+ journal_symlink = '/dev/{symlink}-part{num}'.format(symlink=str(udev_line), num=num)
+ break
+ if not journal_symlink:
+ raise Error('Unable to get device by path from udev')
journal_dmcrypt = None
if journal_dm_keypath: