summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-16 13:14:50 -0700
committerSage Weil <sage@inktank.com>2013-07-16 13:15:07 -0700
commit64379e701b3ed862c05f156539506d3382f77aa8 (patch)
tree3262a78f75da1a2741bae0176cde9c24b306bf37
parent3706dbbf9f56b68df046731218755517e434a514 (diff)
downloadceph-64379e701b3ed862c05f156539506d3382f77aa8.tar.gz
ceph-disk: rely on /dev/disk/by-partuuid instead of special-casing journal symlinks
This was necessary when ceph-disk-udev didn't create the by-partuuid (and other) symlinks for us, but now it is fragile and error-prone. (It also appears to be broken on a certain customer RHEL VM.) See d7f7d613512fe39ec883e11d201793c75ee05db1. Instead, just use the by-partuuid symlinks that we spent all that ugly effort generating. Backport: cuttlefish Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Dan Mick <dan.mick@inktank.com>
-rwxr-xr-xsrc/ceph-disk37
1 files changed, 3 insertions, 34 deletions
diff --git a/src/ceph-disk b/src/ceph-disk
index 35e4592ec4d..cb9d510cf97 100755
--- a/src/ceph-disk
+++ b/src/ceph-disk
@@ -762,16 +762,6 @@ def zap(dev):
raise Error(e)
-def get_udev_version():
- version = _check_output(
- args=[
- 'udevadm',
- '--version',
- ],
- )
- return int(version)
-
-
def prepare_journal_dev(
data,
journal,
@@ -840,30 +830,9 @@ def prepare_journal_dev(
],
)
- if get_udev_version() >= 172:
- journal_symlink = '/dev/disk/by-partuuid/{journal_uuid}'.format(
- journal_uuid=journal_uuid,
- )
- else:
- # udev prior to version 172 doesn't create by-partuuid directory
- # use by-path symlink instead. This is the third symlink returned
- # by udevadm when queried.
- LOG.debug('Using alternate persistant name for journal symlink')
- symlinks = _check_output(
- args=[
- 'udevadm',
- 'info',
- '--query=symlink',
- '--name={name}'.format(name=os.path.basename(journal)),
- ],
- )
- 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_symlink = '/dev/disk/by-partuuid/{journal_uuid}'.format(
+ journal_uuid=journal_uuid,
+ )
journal_dmcrypt = None
if journal_dm_keypath: