diff options
author | David Lehman <dlehman@redhat.com> | 2009-02-23 18:10:46 -0600 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-02-23 18:10:46 -0600 |
commit | ad3af83c337caaecbf4041cbb32c9b32df620100 (patch) | |
tree | de6b307bee716e559f716185171e889b7ad50592 | |
parent | d3f05baaa850eac98c220c04559c2f307fa95539 (diff) | |
download | anaconda-ad3af83c337caaecbf4041cbb32c9b32df620100.tar.gz anaconda-ad3af83c337caaecbf4041cbb32c9b32df620100.tar.xz anaconda-ad3af83c337caaecbf4041cbb32c9b32df620100.zip |
Clean up imports and various typos, add header blocks as needed.
-rw-r--r-- | storage/formats/__init__.py | 8 | ||||
-rw-r--r-- | storage/formats/dmraid.py | 4 | ||||
-rw-r--r-- | storage/formats/fs.py | 6 | ||||
-rw-r--r-- | storage/formats/luks.py | 10 | ||||
-rw-r--r-- | storage/formats/lvmpv.py | 10 | ||||
-rw-r--r-- | storage/formats/mdraid.py | 10 | ||||
-rw-r--r-- | storage/formats/swap.py | 12 |
7 files changed, 30 insertions, 30 deletions
diff --git a/storage/formats/__init__.py b/storage/formats/__init__.py index 016b3eb73..3abd77664 100644 --- a/storage/formats/__init__.py +++ b/storage/formats/__init__.py @@ -22,9 +22,9 @@ import os -from errors import * from iutil import notify_kernel, get_sysfs_path_by_name, log_method_call -from dm import dm_node_from_name +from ..errors import * +from ..devicelibs.dm import dm_node_from_name import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -55,7 +55,8 @@ def get_default_filesystem_type(boot=None): supported = get_device_format_class(fstype).supported except AttributeError: supported = None - elif supported: + + if supported: return fstype raise DeviceFormatError("None of %s is supported by your kernel" % ",".join(fstypes)) @@ -201,7 +202,6 @@ class DeviceFormat(object): else: name = os.path.basename(self.device) - path = get_sysfs_path_by_name(name) try: notify_kernel(path, action="change") diff --git a/storage/formats/dmraid.py b/storage/formats/dmraid.py index acf78da64..3e1d5c3e4 100644 --- a/storage/formats/dmraid.py +++ b/storage/formats/dmraid.py @@ -22,8 +22,8 @@ from iutil import log_method_call #from dm import dm_node_from_name -from errors import * -from deviceformat import * +from ..errors import * +from . import DeviceFormat, register_device_format import gettext _ = lambda x: gettext.ldgettext("anaconda", x) diff --git a/storage/formats/fs.py b/storage/formats/fs.py index dcd340b59..c5ec44a7e 100644 --- a/storage/formats/fs.py +++ b/storage/formats/fs.py @@ -29,8 +29,8 @@ import os import isys -from errors import * -from deviceformat import * +from ..errors import * +from . import DeviceFormat, register_device_format import iutil import logging @@ -396,7 +396,7 @@ class FS(DeviceFormat): # passed in options override default options if not options or not isinstance(options, str): - options = ",".join(self.defaultMountOptions)) + options = ",".join(self.defaultMountOptions) try: rc = isys.mount(self.device, mountpoint, diff --git a/storage/formats/luks.py b/storage/formats/luks.py index d995fa68e..3485f56ad 100644 --- a/storage/formats/luks.py +++ b/storage/formats/luks.py @@ -24,10 +24,10 @@ import os -from errors import * from iutil import log_method_call -from deviceformat import * -import crypto +from ..errors import * +from ..devicelibs import crypto +from . import DeviceFormat, register_device_format import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -39,7 +39,7 @@ log = logging.getLogger("storage") class LUKS(DeviceFormat): """ A LUKS device. """ _type = "luks" - _name "LUKS" + _name = "LUKS" _udevTypes = ["crypto_LUKS"] _formattable = True # can be formatted _supported = True # is supported @@ -70,7 +70,7 @@ class LUKS(DeviceFormat): self.__passphrase = kwargs.get("passphrase") self._key_file = kwargs.get("key_file") - if not self.mapName: + if not self.mapName and self.device: self.mapName = "luks-%s" % os.path.basename(self.device) def _setPassphrase(self, passphrase): diff --git a/storage/formats/lvmpv.py b/storage/formats/lvmpv.py index 9747eb1b6..ac404f303 100644 --- a/storage/formats/lvmpv.py +++ b/storage/formats/lvmpv.py @@ -20,11 +20,11 @@ # Red Hat Author(s): Dave Lehman <dlehman@redhat.com> # -from errors import * from iutil import log_method_call -from deviceformat import * -import lvm -#from parted import PARTITION_LVM +from parted import PARTITION_LVM +from ..errors import * +from ..devicelibs import lvm +from . import DeviceFormat, register_device_format import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -38,7 +38,7 @@ class LVMPhysicalVolume(DeviceFormat): _type = "lvmpv" _name = "physical volume (LVM)" _udevTypes = ["LVM2_member"] - #partedFlags = PARTITION_LVM + partedFlags = PARTITION_LVM _formattable = True # can be formatted _supported = True # is supported _linuxNative = True # for clearpart diff --git a/storage/formats/mdraid.py b/storage/formats/mdraid.py index 0975269b1..90a631c18 100644 --- a/storage/formats/mdraid.py +++ b/storage/formats/mdraid.py @@ -22,11 +22,11 @@ import os -from errors import * from iutil import log_method_call -from deviceformat import * -import mdraid -#from parted import PARTITION_RAID +from parted import PARTITION_RAID +from ..errors import * +from ..devicelibs import mdraid +from . import DeviceFormat, register_device_format import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -40,7 +40,7 @@ class MDRaidMember(DeviceFormat): _type = "mdmember" _name = "software RAID" _udevTypes = ["linux_raid_member"] - #partedFlags = PARTITION_RAID + partedFlags = PARTITION_RAID _formattable = True # can be formatted _supported = True # is supported _linuxNative = True # for clearpart diff --git a/storage/formats/swap.py b/storage/formats/swap.py index 763921503..1888b9837 100644 --- a/storage/formats/swap.py +++ b/storage/formats/swap.py @@ -22,11 +22,11 @@ import os -from errors import * from iutil import log_method_call -from deviceformat import * -import swap -#from parted import PARTITION_SWAP +from parted import PARTITION_SWAP +from ..errors import * +from ..devicelibs import swap +from . import DeviceFormat, register_device_format import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -39,7 +39,7 @@ class SwapSpace(DeviceFormat): """ Swap space """ _type = "swap" _udevTypes = ["swap"] - #partedFlags = PARTITION_SWAP + partedFlags = PARTITION_SWAP _formattable = True # can be formatted _supported = True # is supported _linuxNative = True # for clearpart @@ -88,7 +88,7 @@ class SwapSpace(DeviceFormat): def _setOptions(self, opts): for (opt, arg) in opts.split(","): if opt == "pri": - try: + self.priority = numeric_type(arg) options = property(_getOptions, _setOptions, doc="The swap device's fstab options string") |