[blivet:master 4/4] Use add_metaclass instead of with_metaclass.
mulhern
amulhern at redhat.com
Tue Jul 8 13:55:59 UTC 2014
with_metaclass hides descent from object from pylint analyses and leads
to tons of messages arising from the analysis' belief that it is dealing
with old-style classes.
Signed-off-by: mulhern <amulhern at redhat.com>
---
blivet/devicelibs/raid.py | 8 +++++---
blivet/devices.py | 8 +++++---
blivet/formats/fslabel.py | 5 +++--
blivet/formats/fslabeling.py | 5 +++--
tests/formats_test/fslabeling.py | 5 +++--
5 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/blivet/devicelibs/raid.py b/blivet/devicelibs/raid.py
index 94531c5..50d19dc 100644
--- a/blivet/devicelibs/raid.py
+++ b/blivet/devicelibs/raid.py
@@ -23,7 +23,7 @@
import abc
-from six import with_metaclass
+from six import add_metaclass
from ..errors import RaidError
@@ -35,7 +35,8 @@ def div_up(a,b):
"""
return (a + (b - 1))//b
-class RAIDLevel(with_metaclass(abc.ABCMeta, object)):
+ at add_metaclass(abc.ABCMeta)
+class RAIDLevel(object):
"""An abstract class which is the parent of all classes which represent
a RAID level.
@@ -64,7 +65,8 @@ class RAIDLevel(with_metaclass(abc.ABCMeta, object)):
return self
-class RAIDn(with_metaclass(abc.ABCMeta, RAIDLevel)):
+ at add_metaclass(abc.ABCMeta)
+class RAIDn(RAIDLevel):
"""An abstract class which is the parent of classes which represent a
numeric RAID level. A better word would be classification, since 'level'
diff --git a/blivet/devices.py b/blivet/devices.py
index f402e31..a85202c 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -28,7 +28,7 @@ import abc
from decimal import Decimal
import re
-from six import with_metaclass
+from six import add_metaclass
# device backend modules
from .devicelibs import mdraid
@@ -2241,7 +2241,8 @@ class LUKSDevice(DMCryptDevice):
data.encrypted = True
super(LUKSDevice, self).populateKSData(data)
-class ContainerDevice(with_metaclass(abc.ABCMeta, StorageDevice)):
+ at add_metaclass(abc.ABCMeta)
+class ContainerDevice(StorageDevice):
""" A device that aggregates a set of member devices.
The only interfaces provided by this class are for addition and removal
@@ -3131,7 +3132,8 @@ class LVMLogicalVolumeDevice(DMDevice):
return True
-class LVMSnapShotBase(with_metaclass(abc.ABCMeta, object)):
+ at add_metaclass(abc.ABCMeta)
+class LVMSnapShotBase(object):
""" Abstract base class for lvm snapshots
This class is intended to be used with multiple inheritance in addition
diff --git a/blivet/formats/fslabel.py b/blivet/formats/fslabel.py
index 1dd7b03..2c6fce2 100644
--- a/blivet/formats/fslabel.py
+++ b/blivet/formats/fslabel.py
@@ -22,11 +22,12 @@
import abc
import re
-from six import with_metaclass
+from six import add_metaclass
from .. import errors
-class FSLabelApp(with_metaclass(abc.ABCMeta, object)):
+ at add_metaclass(abc.ABCMeta)
+class FSLabelApp(object):
"""An abstract class that represents actions associated with a
filesystem's labeling application.
"""
diff --git a/blivet/formats/fslabeling.py b/blivet/formats/fslabeling.py
index 33b97c4..f8d7b42 100644
--- a/blivet/formats/fslabeling.py
+++ b/blivet/formats/fslabeling.py
@@ -21,11 +21,12 @@
import abc
-from six import with_metaclass
+from six import add_metaclass
from . import fslabel
-class FSLabeling(with_metaclass(abc.ABCMeta, object)):
+ at add_metaclass(abc.ABCMeta)
+class FSLabeling(object):
"""An abstract class that represents filesystem labeling actions.
"""
diff --git a/tests/formats_test/fslabeling.py b/tests/formats_test/fslabeling.py
index 8bb9d31..f91b323 100644
--- a/tests/formats_test/fslabeling.py
+++ b/tests/formats_test/fslabeling.py
@@ -1,12 +1,13 @@
#!/usr/bin/python
import abc
-from six import with_metaclass
+from six import add_metaclass
from tests import loopbackedtestcase
from blivet.errors import FSError
-class LabelingAsRoot(with_metaclass(abc.ABCMeta, loopbackedtestcase.LoopBackedTestCase)):
+ at add_metaclass(abc.ABCMeta)
+class LabelingAsRoot(loopbackedtestcase.LoopBackedTestCase):
"""Tests various aspects of labeling a filesystem where there
is no easy way to read the filesystem's label once it has been
set and where the filesystem can not be relabeled.
--
1.9.3
More information about the anaconda-patches
mailing list