]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-disk: more robust parted output parser 4503/head
authorLoic Dachary <ldachary@redhat.com>
Sun, 8 Mar 2015 14:15:35 +0000 (15:15 +0100)
committerLoic Dachary <ldachary@redhat.com>
Wed, 29 Apr 2015 18:24:10 +0000 (20:24 +0200)
commit8709e34f931809f7129cdac1203ec4e774e3eb4c
tree11b531d2071553e5fef94d4375a86e5e9b01d70c
parent74c2dc1f3924fa05e2c40f4cceb2ab060493bdfb
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>
(cherry picked from commit f5acf6bb6a342b05897605703d7d9cb7c09714fd)
src/ceph-disk