Skip to content
Snippets Groups Projects
Commit 38396ae2 authored by Thomas Thrainer's avatar Thomas Thrainer Committed by Michele Tartara
Browse files

Rename _MassageProcData to _JoinProcDataPerMinor


That's what the method actually does, so there is no reason why we
should use a funny but unreadable name.

Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent decf86f9
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,7 @@ class BaseDRBD(base.BlockDev): # pylint: disable=W0223 ...@@ -81,7 +81,7 @@ class BaseDRBD(base.BlockDev): # pylint: disable=W0223
return data return data
@classmethod @classmethod
def _MassageProcData(cls, data): def _JoinProcDataPerMinor(cls, data):
"""Transform the output of _GetProdData into a nicer form. """Transform the output of _GetProdData into a nicer form.
@return: a dictionary of minor: joined lines from /proc/drbd @return: a dictionary of minor: joined lines from /proc/drbd
...@@ -944,7 +944,7 @@ class DRBD8(BaseDRBD): ...@@ -944,7 +944,7 @@ class DRBD8(BaseDRBD):
if self.minor is None: if self.minor is None:
base.ThrowError("drbd%d: GetStats() called while not attached", base.ThrowError("drbd%d: GetStats() called while not attached",
self._aminor) self._aminor)
proc_info = self._MassageProcData(self._GetProcData()) proc_info = self._JoinProcDataPerMinor(self._GetProcData())
if self.minor not in proc_info: if self.minor not in proc_info:
base.ThrowError("drbd%d: can't find myself in /proc", self.minor) base.ThrowError("drbd%d: can't find myself in /proc", self.minor)
return DRBD8Status(proc_info[self.minor]) return DRBD8Status(proc_info[self.minor])
...@@ -1319,7 +1319,7 @@ class DRBD8(BaseDRBD): ...@@ -1319,7 +1319,7 @@ class DRBD8(BaseDRBD):
" exclusive_storage") " exclusive_storage")
# check that the minor is unused # check that the minor is unused
aminor = unique_id[4] aminor = unique_id[4]
proc_info = cls._MassageProcData(cls._GetProcData()) proc_info = cls._JoinProcDataPerMinor(cls._GetProcData())
if aminor in proc_info: if aminor in proc_info:
status = DRBD8Status(proc_info[aminor]) status = DRBD8Status(proc_info[aminor])
in_use = status.is_in_use in_use = status.is_in_use
......
...@@ -250,12 +250,13 @@ class TestDRBD8Status(testutils.GanetiTestCase): ...@@ -250,12 +250,13 @@ class TestDRBD8Status(testutils.GanetiTestCase):
self.proc83_sync_data = drbd.DRBD8._GetProcData(filename=proc83_sync_data) self.proc83_sync_data = drbd.DRBD8._GetProcData(filename=proc83_sync_data)
self.proc83_sync_krnl_data = \ self.proc83_sync_krnl_data = \
drbd.DRBD8._GetProcData(filename=proc83_sync_krnl_data) drbd.DRBD8._GetProcData(filename=proc83_sync_krnl_data)
self.mass_data = drbd.DRBD8._MassageProcData(self.proc_data) self.mass_data = drbd.DRBD8._JoinProcDataPerMinor(self.proc_data)
self.mass80e_data = drbd.DRBD8._MassageProcData(self.proc80e_data) self.mass80e_data = drbd.DRBD8._JoinProcDataPerMinor(self.proc80e_data)
self.mass83_data = drbd.DRBD8._MassageProcData(self.proc83_data) self.mass83_data = drbd.DRBD8._JoinProcDataPerMinor(self.proc83_data)
self.mass83_sync_data = drbd.DRBD8._MassageProcData(self.proc83_sync_data) self.mass83_sync_data = \
drbd.DRBD8._JoinProcDataPerMinor(self.proc83_sync_data)
self.mass83_sync_krnl_data = \ self.mass83_sync_krnl_data = \
drbd.DRBD8._MassageProcData(self.proc83_sync_krnl_data) drbd.DRBD8._JoinProcDataPerMinor(self.proc83_sync_krnl_data)
def testIOErrors(self): def testIOErrors(self):
"""Test handling of errors while reading the proc file.""" """Test handling of errors while reading the proc file."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment