]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-disk: more robust parted output parser 3872/head
authorLoic Dachary <ldachary@redhat.com>
Sun, 8 Mar 2015 14:15:35 +0000 (15:15 +0100)
committerLoic Dachary <ldachary@redhat.com>
Wed, 11 Mar 2015 13:02:54 +0000 (14:02 +0100)
commitf5acf6bb6a342b05897605703d7d9cb7c09714fd
tree6dec8165dcaca8ee585c7f13e2dac2cc8605c82e
parentaf3a37fb9d7e0cbdf5a1d34f88140da7c262be20
ceph-disk: more robust parted output parser

In some cases, depending on the implementation or the operating system,

   parted --machine -- /dev/sdh print

may contain empty lines. The current parsing code is fragile and highly
depends on output details. Replace it with code that basically does the
same sanity checks (output not empty, existence of units, existence of
the dev entry) but handles the entire output instead of checking line by
line.

http://tracker.ceph.com/issues/10983 Fixes: #10983

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/ceph-disk