relative imports fixed

This commit is contained in:
Anders Ingemann 2014-03-23 20:02:26 +01:00
parent 18dfefe560
commit 6d757d2598
14 changed files with 31 additions and 23 deletions

View file

@ -0,0 +1,8 @@
__version__ = '0.9'
if __name__ == '__main__':
from base import main
sys.exit(main())

View file

@ -9,10 +9,10 @@ def load_volume(data, bootloader):
Returns:
Volume. The volume that represents all information pertaining to the volume we bootstrap on
"""
from common.fs.loopbackvolume import LoopbackVolume
from providers.ec2.ebsvolume import EBSVolume
from common.fs.virtualdiskimage import VirtualDiskImage
from common.fs.virtualmachinedisk import VirtualMachineDisk
from ...common.fs.loopbackvolume import LoopbackVolume
from ...providers.ec2.ebsvolume import EBSVolume
from ...common.fs.virtualdiskimage import VirtualDiskImage
from ...common.fs.virtualmachinedisk import VirtualMachineDisk
# Create a mapping between valid partition maps in the manifest and their corresponding classes
from partitionmaps.gpt import GPTPartitionMap
from partitionmaps.msdos import MSDOSPartitionMap

View file

@ -1,7 +1,7 @@
from abc import ABCMeta
from abc import abstractmethod
from common.tools import log_check_call
from common.fsm_proxy import FSMProxy
from ....common.tools import log_check_call
from ....common.fsm_proxy import FSMProxy
from ..exceptions import PartitionError

View file

@ -1,7 +1,7 @@
from abstract import AbstractPartitionMap
from ..partitions.gpt import GPTPartition
from ..partitions.gpt_swap import GPTSwapPartition
from common.tools import log_check_call
from ....common.tools import log_check_call
class GPTPartitionMap(AbstractPartitionMap):
@ -14,7 +14,7 @@ class GPTPartitionMap(AbstractPartitionMap):
data (dict): volume.partitions part of the manifest
bootloader (str): Name of the bootloader we will use for bootstrapping
"""
from common.bytes import Bytes
from ....common.bytes import Bytes
# List of partitions
self.partitions = []

View file

@ -1,7 +1,7 @@
from abstract import AbstractPartitionMap
from ..partitions.msdos import MSDOSPartition
from ..partitions.msdos_swap import MSDOSSwapPartition
from common.tools import log_check_call
from ....common.tools import log_check_call
class MSDOSPartitionMap(AbstractPartitionMap):
@ -15,7 +15,7 @@ class MSDOSPartitionMap(AbstractPartitionMap):
data (dict): volume.partitions part of the manifest
bootloader (str): Name of the bootloader we will use for bootstrapping
"""
from common.bytes import Bytes
from ....common.bytes import Bytes
# List of partitions
self.partitions = []

View file

@ -13,7 +13,7 @@ class NoPartitions(object):
data (dict): volume.partitions part of the manifest
bootloader (str): Name of the bootloader we will use for bootstrapping
"""
from common.bytes import Bytes
from ....common.bytes import Bytes
# In the NoPartitions partitions map we only have a single 'partition'
self.root = SinglePartition(Bytes(data['root']['size']),
data['root']['filesystem'], data['root'].get('format_command', None))

View file

@ -1,8 +1,8 @@
from abc import ABCMeta
from abc import abstractmethod
import os.path
from common.tools import log_check_call
from common.fsm_proxy import FSMProxy
from ....common.tools import log_check_call
from ....common.fsm_proxy import FSMProxy
class AbstractPartition(FSMProxy):

View file

@ -1,4 +1,4 @@
from common.tools import log_check_call
from ....common.tools import log_check_call
from base import BasePartition

View file

@ -1,4 +1,4 @@
from common.tools import log_check_call
from ....common.tools import log_check_call
from gpt import GPTPartition

View file

@ -1,4 +1,4 @@
from common.tools import log_check_call
from ....common.tools import log_check_call
from msdos import MSDOSPartition

View file

@ -11,6 +11,6 @@ class SinglePartition(AbstractPartition):
Returns:
Bytes. The starting byte of this partition
"""
from common.bytes import Bytes
from ....common.bytes import Bytes
# On an unpartitioned volume there is no offset and no previous partition
return Bytes(0)

View file

@ -1,7 +1,7 @@
from abc import ABCMeta
from common.fsm_proxy import FSMProxy
from common.tools import log_check_call
from exceptions import VolumeError
from ...common.fsm_proxy import FSMProxy
from ...common.tools import log_check_call
from .exceptions import VolumeError
from partitionmaps.none import NoPartitions
@ -90,7 +90,7 @@ class Volume(FSMProxy):
VolumeError
"""
import os.path
from common.fs import get_partitions
from ...common.fs import get_partitions
# Fetch information from /proc/partitions
proc_partitions = get_partitions()
device_name = os.path.basename(self.device_path)

View file

@ -3,7 +3,7 @@ to determine which tasks should be added to the tasklist, what arguments various
invocations should have etc..
.. module:: manifest
"""
from common.tools import load_json
from ..common.tools import load_json
import logging
log = logging.getLogger(__name__)

View file

@ -2,7 +2,7 @@
.. module:: tasklist
"""
from common.exceptions import TaskListError
from ..common.exceptions import TaskListError
import logging
log = logging.getLogger(__name__)