RBD: Pass bytes type for mon_command inbuf
Ceph Pacific enforces that bytes instead of str are used here. Closes-Bug: #1913449 Change-Id: Icf9f6409009250f766f619019252617fc9b3e1e7
This commit is contained in:
parent
677ee75d5d
commit
11704d0e8c
@ -1544,9 +1544,9 @@ class RBDTestCase(test.TestCase):
|
||||
return_value=dynamic_total):
|
||||
result = self.driver._get_pool_stats()
|
||||
client.cluster.mon_command.assert_has_calls([
|
||||
mock.call('{"prefix":"df", "format":"json"}', ''),
|
||||
mock.call('{"prefix":"df", "format":"json"}', b''),
|
||||
mock.call('{"prefix":"osd pool get-quota", "pool": "rbd",'
|
||||
' "format":"json"}', ''),
|
||||
' "format":"json"}', b''),
|
||||
])
|
||||
self.assertEqual((free_capacity, total_capacity), result)
|
||||
|
||||
@ -1567,9 +1567,9 @@ class RBDTestCase(test.TestCase):
|
||||
]
|
||||
result = self.driver._get_pool_stats()
|
||||
client.cluster.mon_command.assert_has_calls([
|
||||
mock.call('{"prefix":"df", "format":"json"}', ''),
|
||||
mock.call('{"prefix":"df", "format":"json"}', b''),
|
||||
mock.call('{"prefix":"osd pool get-quota", "pool": "rbd",'
|
||||
' "format":"json"}', ''),
|
||||
' "format":"json"}', b''),
|
||||
])
|
||||
free_capacity = 1.56
|
||||
total_capacity = 3.0
|
||||
|
@ -558,14 +558,14 @@ class RBDDriver(driver.CloneableImageVD, driver.MigrateVD,
|
||||
|
||||
with RADOSClient(self) as client:
|
||||
ret, df_outbuf, __ = client.cluster.mon_command(
|
||||
'{"prefix":"df", "format":"json"}', '')
|
||||
'{"prefix":"df", "format":"json"}', b'')
|
||||
if ret:
|
||||
LOG.warning('Unable to get rados pool stats.')
|
||||
return 'unknown', 'unknown'
|
||||
|
||||
ret, quota_outbuf, __ = client.cluster.mon_command(
|
||||
'{"prefix":"osd pool get-quota", "pool": "%s",'
|
||||
' "format":"json"}' % pool_name, '')
|
||||
' "format":"json"}' % pool_name, b'')
|
||||
if ret:
|
||||
LOG.warning('Unable to get rados pool quotas.')
|
||||
return 'unknown', 'unknown'
|
||||
|
7
releasenotes/notes/bug-1913449-4796b366ae7e871b.yaml
Normal file
7
releasenotes/notes/bug-1913449-4796b366ae7e871b.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
`Bug 1913449 <https://bugs.launchpad.net/cinder/+bug/1913449>`_:
|
||||
Fix RBD driver _update_volume_stats() failing when using Ceph
|
||||
Pacific python rados libraries. This failed because we
|
||||
were passing a str instead of bytes to cluster.mon_command()
|
Loading…
Reference in New Issue
Block a user