diff options
author | Sage Weil <sage@inktank.com> | 2013-07-16 13:14:50 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-07-16 15:14:52 -0700 |
commit | 39bffac6b6c898882d03de392f7f2218933d942b (patch) | |
tree | 8e3033258a1057230303ef80b26e8869f42539b9 | |
parent | 363d54288254b5e2311cd28fce5988d68cfd5773 (diff) | |
download | ceph-39bffac6b6c898882d03de392f7f2218933d942b.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>
(cherry picked from commit 64379e701b3ed862c05f156539506d3382f77aa8)
-rwxr-xr-x | src/ceph-disk | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/src/ceph-disk b/src/ceph-disk index e13a0c29970..36c75b5d598 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -755,16 +755,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, @@ -833,30 +823,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: |