]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-disk: more robust parted output parser 4630/head
authorLoic Dachary <ldachary@redhat.com>
Sun, 8 Mar 2015 14:15:35 +0000 (15:15 +0100)
committerNathan Cutler <ncutler@suse.cz>
Sat, 9 May 2015 15:16:46 +0000 (17:16 +0200)
commit909096713dcef5dc4fdbb22a9971609554688e23
tree56d3c018259fc952edda4ba9d8dfa07fe6a02e29
parentfcd0ea3383582e7a1dc8091e7a48e1d4bbaa76ee
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