Move exception to it's own file (again)

Moving the exception didn't cause problems in
I925ed62bdc808f0e07862f6e0905e80b50fbe942, but in later changes where
we split blockdevice.py up a bit more, we can get a bit tangled with
circular imports.

Change-Id: I8297483f64c4e1deecd5ec88ee40e9198bb83589
This commit is contained in:
Ian Wienand 2017-05-19 08:42:00 +10:00 committed by Andreas Florath
parent 45272343c5
commit 4e08765f87
6 changed files with 21 additions and 8 deletions

View File

@ -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.

View File

@ -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"""

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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