diff --git a/diskimage_builder/block_device/blockdevice.py b/diskimage_builder/block_device/blockdevice.py index 4d10bb92..0cf44bf4 100644 --- a/diskimage_builder/block_device/blockdevice.py +++ b/diskimage_builder/block_device/blockdevice.py @@ -22,6 +22,8 @@ import yaml from stevedore import extension +from diskimage_builder.block_device.exception import \ + BlockDeviceSetupException from diskimage_builder.block_device.utils import exec_sudo from diskimage_builder.graph.digraph import Digraph @@ -29,10 +31,6 @@ from diskimage_builder.graph.digraph import Digraph logger = logging.getLogger(__name__) -class BlockDeviceSetupException(Exception): - pass - - class BlockDevice(object): """Handles block devices. diff --git a/diskimage_builder/block_device/exception.py b/diskimage_builder/block_device/exception.py new file mode 100644 index 00000000..92dc602a --- /dev/null +++ b/diskimage_builder/block_device/exception.py @@ -0,0 +1,15 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +class BlockDeviceSetupException(Exception): + """Generic exception""" diff --git a/diskimage_builder/block_device/level0/localloop.py b/diskimage_builder/block_device/level0/localloop.py index 4df7af2b..a776ecae 100644 --- a/diskimage_builder/block_device/level0/localloop.py +++ b/diskimage_builder/block_device/level0/localloop.py @@ -16,7 +16,7 @@ import logging import os import subprocess -from diskimage_builder.block_device.blockdevice import \ +from diskimage_builder.block_device.exception import \ BlockDeviceSetupException from diskimage_builder.block_device.tree_config import TreeConfig from diskimage_builder.block_device.utils import parse_abs_size_spec diff --git a/diskimage_builder/block_device/level1/partitioning.py b/diskimage_builder/block_device/level1/partitioning.py index 05114898..6ca11043 100644 --- a/diskimage_builder/block_device/level1/partitioning.py +++ b/diskimage_builder/block_device/level1/partitioning.py @@ -17,7 +17,7 @@ import os from subprocess import CalledProcessError -from diskimage_builder.block_device.blockdevice import \ +from diskimage_builder.block_device.exception import \ BlockDeviceSetupException from diskimage_builder.block_device.level1.mbr import MBR from diskimage_builder.block_device.tree_config import TreeConfig diff --git a/diskimage_builder/block_device/level2/mkfs.py b/diskimage_builder/block_device/level2/mkfs.py index 4ce4cdd2..ba4469c5 100644 --- a/diskimage_builder/block_device/level2/mkfs.py +++ b/diskimage_builder/block_device/level2/mkfs.py @@ -15,7 +15,7 @@ import logging import uuid -from diskimage_builder.block_device.blockdevice \ +from diskimage_builder.block_device.exception \ import BlockDeviceSetupException from diskimage_builder.block_device.tree_config import TreeConfig from diskimage_builder.block_device.utils import exec_sudo diff --git a/diskimage_builder/block_device/level3/mount.py b/diskimage_builder/block_device/level3/mount.py index a0f0e91c..1046f29c 100644 --- a/diskimage_builder/block_device/level3/mount.py +++ b/diskimage_builder/block_device/level3/mount.py @@ -15,7 +15,7 @@ import logging import os -from diskimage_builder.block_device.blockdevice \ +from diskimage_builder.block_device.exception \ import BlockDeviceSetupException from diskimage_builder.block_device.tree_config import TreeConfig from diskimage_builder.block_device.utils import exec_sudo