Revision 38396ae2 lib/block/drbd.py
b/lib/block/drbd.py | ||
---|---|---|
81 | 81 |
return data |
82 | 82 |
|
83 | 83 |
@classmethod |
84 |
def _MassageProcData(cls, data):
|
|
84 |
def _JoinProcDataPerMinor(cls, data):
|
|
85 | 85 |
"""Transform the output of _GetProdData into a nicer form. |
86 | 86 |
|
87 | 87 |
@return: a dictionary of minor: joined lines from /proc/drbd |
... | ... | |
944 | 944 |
if self.minor is None: |
945 | 945 |
base.ThrowError("drbd%d: GetStats() called while not attached", |
946 | 946 |
self._aminor) |
947 |
proc_info = self._MassageProcData(self._GetProcData())
|
|
947 |
proc_info = self._JoinProcDataPerMinor(self._GetProcData())
|
|
948 | 948 |
if self.minor not in proc_info: |
949 | 949 |
base.ThrowError("drbd%d: can't find myself in /proc", self.minor) |
950 | 950 |
return DRBD8Status(proc_info[self.minor]) |
... | ... | |
1319 | 1319 |
" exclusive_storage") |
1320 | 1320 |
# check that the minor is unused |
1321 | 1321 |
aminor = unique_id[4] |
1322 |
proc_info = cls._MassageProcData(cls._GetProcData())
|
|
1322 |
proc_info = cls._JoinProcDataPerMinor(cls._GetProcData())
|
|
1323 | 1323 |
if aminor in proc_info: |
1324 | 1324 |
status = DRBD8Status(proc_info[aminor]) |
1325 | 1325 |
in_use = status.is_in_use |
Also available in: Unified diff