mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
relative imports fixed
This commit is contained in:
parent
18dfefe560
commit
6d757d2598
14 changed files with 31 additions and 23 deletions
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
|
||||||
|
__version__ = '0.9'
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
from base import main
|
||||||
|
sys.exit(main())
|
|
@ -9,10 +9,10 @@ def load_volume(data, bootloader):
|
||||||
Returns:
|
Returns:
|
||||||
Volume. The volume that represents all information pertaining to the volume we bootstrap on
|
Volume. The volume that represents all information pertaining to the volume we bootstrap on
|
||||||
"""
|
"""
|
||||||
from common.fs.loopbackvolume import LoopbackVolume
|
from ...common.fs.loopbackvolume import LoopbackVolume
|
||||||
from providers.ec2.ebsvolume import EBSVolume
|
from ...providers.ec2.ebsvolume import EBSVolume
|
||||||
from common.fs.virtualdiskimage import VirtualDiskImage
|
from ...common.fs.virtualdiskimage import VirtualDiskImage
|
||||||
from common.fs.virtualmachinedisk import VirtualMachineDisk
|
from ...common.fs.virtualmachinedisk import VirtualMachineDisk
|
||||||
# Create a mapping between valid partition maps in the manifest and their corresponding classes
|
# Create a mapping between valid partition maps in the manifest and their corresponding classes
|
||||||
from partitionmaps.gpt import GPTPartitionMap
|
from partitionmaps.gpt import GPTPartitionMap
|
||||||
from partitionmaps.msdos import MSDOSPartitionMap
|
from partitionmaps.msdos import MSDOSPartitionMap
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from abc import ABCMeta
|
from abc import ABCMeta
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from common.tools import log_check_call
|
from ....common.tools import log_check_call
|
||||||
from common.fsm_proxy import FSMProxy
|
from ....common.fsm_proxy import FSMProxy
|
||||||
from ..exceptions import PartitionError
|
from ..exceptions import PartitionError
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from abstract import AbstractPartitionMap
|
from abstract import AbstractPartitionMap
|
||||||
from ..partitions.gpt import GPTPartition
|
from ..partitions.gpt import GPTPartition
|
||||||
from ..partitions.gpt_swap import GPTSwapPartition
|
from ..partitions.gpt_swap import GPTSwapPartition
|
||||||
from common.tools import log_check_call
|
from ....common.tools import log_check_call
|
||||||
|
|
||||||
|
|
||||||
class GPTPartitionMap(AbstractPartitionMap):
|
class GPTPartitionMap(AbstractPartitionMap):
|
||||||
|
@ -14,7 +14,7 @@ class GPTPartitionMap(AbstractPartitionMap):
|
||||||
data (dict): volume.partitions part of the manifest
|
data (dict): volume.partitions part of the manifest
|
||||||
bootloader (str): Name of the bootloader we will use for bootstrapping
|
bootloader (str): Name of the bootloader we will use for bootstrapping
|
||||||
"""
|
"""
|
||||||
from common.bytes import Bytes
|
from ....common.bytes import Bytes
|
||||||
# List of partitions
|
# List of partitions
|
||||||
self.partitions = []
|
self.partitions = []
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from abstract import AbstractPartitionMap
|
from abstract import AbstractPartitionMap
|
||||||
from ..partitions.msdos import MSDOSPartition
|
from ..partitions.msdos import MSDOSPartition
|
||||||
from ..partitions.msdos_swap import MSDOSSwapPartition
|
from ..partitions.msdos_swap import MSDOSSwapPartition
|
||||||
from common.tools import log_check_call
|
from ....common.tools import log_check_call
|
||||||
|
|
||||||
|
|
||||||
class MSDOSPartitionMap(AbstractPartitionMap):
|
class MSDOSPartitionMap(AbstractPartitionMap):
|
||||||
|
@ -15,7 +15,7 @@ class MSDOSPartitionMap(AbstractPartitionMap):
|
||||||
data (dict): volume.partitions part of the manifest
|
data (dict): volume.partitions part of the manifest
|
||||||
bootloader (str): Name of the bootloader we will use for bootstrapping
|
bootloader (str): Name of the bootloader we will use for bootstrapping
|
||||||
"""
|
"""
|
||||||
from common.bytes import Bytes
|
from ....common.bytes import Bytes
|
||||||
# List of partitions
|
# List of partitions
|
||||||
self.partitions = []
|
self.partitions = []
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class NoPartitions(object):
|
||||||
data (dict): volume.partitions part of the manifest
|
data (dict): volume.partitions part of the manifest
|
||||||
bootloader (str): Name of the bootloader we will use for bootstrapping
|
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'
|
# In the NoPartitions partitions map we only have a single 'partition'
|
||||||
self.root = SinglePartition(Bytes(data['root']['size']),
|
self.root = SinglePartition(Bytes(data['root']['size']),
|
||||||
data['root']['filesystem'], data['root'].get('format_command', None))
|
data['root']['filesystem'], data['root'].get('format_command', None))
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
from abc import ABCMeta
|
from abc import ABCMeta
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
import os.path
|
import os.path
|
||||||
from common.tools import log_check_call
|
from ....common.tools import log_check_call
|
||||||
from common.fsm_proxy import FSMProxy
|
from ....common.fsm_proxy import FSMProxy
|
||||||
|
|
||||||
|
|
||||||
class AbstractPartition(FSMProxy):
|
class AbstractPartition(FSMProxy):
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from common.tools import log_check_call
|
from ....common.tools import log_check_call
|
||||||
from base import BasePartition
|
from base import BasePartition
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from common.tools import log_check_call
|
from ....common.tools import log_check_call
|
||||||
from gpt import GPTPartition
|
from gpt import GPTPartition
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from common.tools import log_check_call
|
from ....common.tools import log_check_call
|
||||||
from msdos import MSDOSPartition
|
from msdos import MSDOSPartition
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,6 @@ class SinglePartition(AbstractPartition):
|
||||||
Returns:
|
Returns:
|
||||||
Bytes. The starting byte of this partition
|
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
|
# On an unpartitioned volume there is no offset and no previous partition
|
||||||
return Bytes(0)
|
return Bytes(0)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from abc import ABCMeta
|
from abc import ABCMeta
|
||||||
from common.fsm_proxy import FSMProxy
|
from ...common.fsm_proxy import FSMProxy
|
||||||
from common.tools import log_check_call
|
from ...common.tools import log_check_call
|
||||||
from exceptions import VolumeError
|
from .exceptions import VolumeError
|
||||||
from partitionmaps.none import NoPartitions
|
from partitionmaps.none import NoPartitions
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ class Volume(FSMProxy):
|
||||||
VolumeError
|
VolumeError
|
||||||
"""
|
"""
|
||||||
import os.path
|
import os.path
|
||||||
from common.fs import get_partitions
|
from ...common.fs import get_partitions
|
||||||
# Fetch information from /proc/partitions
|
# Fetch information from /proc/partitions
|
||||||
proc_partitions = get_partitions()
|
proc_partitions = get_partitions()
|
||||||
device_name = os.path.basename(self.device_path)
|
device_name = os.path.basename(self.device_path)
|
||||||
|
|
|
@ -3,7 +3,7 @@ to determine which tasks should be added to the tasklist, what arguments various
|
||||||
invocations should have etc..
|
invocations should have etc..
|
||||||
.. module:: manifest
|
.. module:: manifest
|
||||||
"""
|
"""
|
||||||
from common.tools import load_json
|
from ..common.tools import load_json
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.. module:: tasklist
|
.. module:: tasklist
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from common.exceptions import TaskListError
|
from ..common.exceptions import TaskListError
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue