[blivet 00/13] Refactor abstract RAID concept into a separate module

mulhern amulhern at redhat.com
Tue Nov 26 18:47:05 UTC 2013


These are revisions of a previous patch set.

The first four are basically uninteresting, and the same as last time.

The fifth is the actual classes that support the RAID concept. The big
change here is that the ability to find a particular RAID object is
encapsulated in an object, so that the the RAID concept is reusable by
other clients.

The next alters mdraid.py to make user of the new raid classes, but
limits any actual behavior change to the mdraid package.

The next changes MDRaidArrayDevice to use raid. These changes were tricky. 
Any mistakes are probably misunderstanding of what we're trying to model,
not mistakes in code. This should get a bit of scrutiny.

The remaining patches tear out the mdraid functions that are implemented
by means of raid functions and just pass calls through to those functions.
The first one
is easy, because mdraid.get_raid_max_spares is not used by any code in blivet
or elsewhere after changes. mdraid.raid_levels is also unused, so it is just
as easy. The next is harder, but it frees up
mdraid.get_member_space to be removed. Well, after all these changes, nothing
uses raidLevelString, so that gets removed. Then, raidLevel and
get_raid_min_members are removed. This is significant, because there is
code in anaconda that uses these two, so this final patch is codependent on 
one in ananconda. The last to go is the RAID level constants in mdraid.
There's an anaconda patch that goes with this one as well.

mulhern (13):
  Add some basic unit tests for MDRaidArrayDevice.
  Make MDRaidArrayDevice initializer not except raid level of None.
  Add some additional unit tests in mdraid_tests.py.
  A few small tests for MDFactory class.
  Implement a RAID class hierarchy.
  Changed devicelibs.mdraid to make use of devicelibs.raid.
  Change MDRaidArrayDevice to use raid package.
  Removed mdraid.get_raid_max_spares.
  Removed mdraid.raid_levels
  In devicefactory.py change mdraid procedures call to raid method
    calls.
  Remove raidLevelString in raid and mdraid.
  Remove raidLevel and get_raid_min_members for mdraid.py.
  Removed raid level constants from mdraid.py.

 blivet/devicefactory.py              |  39 +---
 blivet/devicelibs/lvm.py             |   3 +-
 blivet/devicelibs/mdraid.py          | 139 ++++--------
 blivet/devicelibs/raid.py            | 400 +++++++++++++++++++++++++++++++++++
 blivet/devices.py                    | 131 ++++--------
 blivet/errors.py                     |   3 +
 tests/devicefactory_test.py          |  60 ++++++
 tests/devicelibs_test/mdraid_test.py |  43 ++--
 tests/devicelibs_test/raid_test.py   | 133 ++++++++++++
 tests/devices_test.py                | 383 +++++++++++++++++++++++++++++++++
 tests/storagetestcase.py             |   9 -
 11 files changed, 1095 insertions(+), 248 deletions(-)
 create mode 100644 blivet/devicelibs/raid.py
 create mode 100644 tests/devicefactory_test.py
 create mode 100644 tests/devicelibs_test/raid_test.py
 create mode 100644 tests/devices_test.py

-- 
1.8.3.1



More information about the anaconda-patches mailing list