From: Sage Weil Date: Wed, 13 Aug 2014 19:00:50 +0000 (-0700) Subject: ceph-disk: warn about falling back to sgdisk (once) X-Git-Tag: v0.80.6~55 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=08772fd888fb0eca4570bd6b4bb25f8122691cb4;p=ceph.git 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 (cherry picked from commit 6f7798e37e098de38fbc73f86c4c6ee705abbe38) --- diff --git a/src/ceph-disk b/src/ceph-disk index 711365f4744..fca535220e2 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. @@ -2195,6 +2198,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( [ @@ -2743,3 +2749,4 @@ def main(): if __name__ == '__main__': main() + warned_about = {}