From 6f7798e37e098de38fbc73f86c4c6ee705abbe38 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 13 Aug 2014 12:00:50 -0700 Subject: [PATCH] ceph-disk: warn about falling back to sgdisk (once) This way the user knows something funny might be up if dmcrypt is in use. Signed-off-by: Sage Weil --- src/ceph-disk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ceph-disk b/src/ceph-disk index 1e8cf795daae3..1bd380a08fa77 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -119,6 +119,9 @@ STATEDIR = '/var/lib/ceph' SYSCONFDIR = '/etc/ceph' +# only warn once about some things +warned_about = {} + # Nuke the TERM variable to avoid confusing any subprocesses we call. # For example, libreadline will print weird control sequences for some # TERM values. @@ -2193,6 +2196,9 @@ def get_partition_type(part): return None # GPT, and blkid appears to be new, so we're done. # bah, fall back to sgdisk. + if 'blkid' not in warned_about: + LOG.warning('Old blkid does not support ID_PART_ENTRY_* fields, trying sgdisk; may not correctly identify ceph volumes with dmcrypt') + warned_about['blkid'] = True (base, partnum) = re.match('(\D+)(\d+)', part).group(1, 2) sgdisk, _ = command( [ @@ -2741,3 +2747,4 @@ def main(): if __name__ == '__main__': main() + warned_about = {} -- 2.39.5