pyocf: add get_bytes() function to Volume and Data

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski 2021-12-16 21:02:41 +01:00
parent 683174c78f
commit c43059a4cf
2 changed files with 7 additions and 0 deletions

View File

@ -223,3 +223,7 @@ class Data:
m = md5() m = md5()
m.update(string_at(self.handle, self.size)) m.update(string_at(self.handle, self.size))
return m.hexdigest() return m.hexdigest()
def get_bytes(self):
return string_at(self.handle, self.size)

View File

@ -312,6 +312,9 @@ class Volume(Structure):
m.update(string_at(self._storage, self.size)) m.update(string_at(self._storage, self.size))
return m.hexdigest() return m.hexdigest()
def get_bytes(self):
return string_at(self._storage, self.size)
class ErrorDevice(Volume): class ErrorDevice(Volume):
def __init__( def __init__(