Merge "StorPool: parse the output of blockdev
correctly."
This commit is contained in:
commit
35f0ac5bfa
@ -191,7 +191,7 @@ class StorPoolConnector(base.BaseLinuxConnector):
|
||||
(out, _err) = self._execute('blockdev', '--getsize64',
|
||||
device, run_as_root=True,
|
||||
root_helper=self._root_helper)
|
||||
var = six.text_type(out)
|
||||
var = six.text_type(out).strip()
|
||||
if var.isnumeric():
|
||||
return int(var)
|
||||
else:
|
||||
|
@ -85,7 +85,7 @@ class StorPoolConnectorTestCase(test_connector.ConnectorTestCase):
|
||||
self.assertEqual(cmd[1], '--getsize64')
|
||||
self.assertEqual(cmd[2], '/dev/storpool/' +
|
||||
self.volumeName(self.fakeProp['volume']))
|
||||
return (str(self.fakeSize), None)
|
||||
return (str(self.fakeSize) + '\n', None)
|
||||
raise Exception("Unrecognized command passed to " +
|
||||
type(self).__name__ + ".execute(): " +
|
||||
str.join(", ", map(lambda s: "'" + s + "'", cmd)))
|
||||
|
Loading…
Reference in New Issue
Block a user