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:
parent
45272343c5
commit
4e08765f87
@ -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.
|
||||
|
||||
|
15
diskimage_builder/block_device/exception.py
Normal file
15
diskimage_builder/block_device/exception.py
Normal 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"""
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user