You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
The function charmhelpers.contrib.storage.linux.lvm.remove_lvm_physical_volume is passing an erroneous argument to the method communicate of the standard Popen class.
we can see that it's being passed a string, but after using it in the cinder-lvm charm, I get the following traceback:
File "lib/charm/openstack/cinder_lvm.py", line 265, in prepare_volume
clean_storage(device)
File "lib/charm/openstack/cinder_lvm.py", line 293, in clean_storage
remove_lvm_physical_volume(block_device)
File "/var/lib/juju/agents/unit-cinder-lvm-0/.venv/lib/python3.6/site-packages/charmhelpers/contrib/storage/linux/lvm.py", line 63, in remove_lvm_physical_volume
p.communicate(input='y\n')
File "/usr/lib/python3.6/subprocess.py", line 848, in communicate
self._stdin_write(input)
File "/usr/lib/python3.6/subprocess.py", line 801, in _stdin_write
self.stdin.write(input)
TypeError: a bytes-like object is required, not 'str'
A simple fix would be to use the bytes equivalent: b'y\n'.
The text was updated successfully, but these errors were encountered:
Hello,
The function
charmhelpers.contrib.storage.linux.lvm.remove_lvm_physical_volume
is passing an erroneous argument to the methodcommunicate
of the standardPopen
class.Here: https://github.com/juju/charm-helpers/blob/master/charmhelpers/contrib/storage/linux/lvm.py#L63
we can see that it's being passed a string, but after using it in the cinder-lvm charm, I get the following traceback:
A simple fix would be to use the bytes equivalent:
b'y\n'
.The text was updated successfully, but these errors were encountered: