diff --git a/base/phase.py b/base/phase.py index 9dab1b3..1ed1233 100644 --- a/base/phase.py +++ b/base/phase.py @@ -1,7 +1,8 @@ class Phase(object): - def __init__(self, description): + def __init__(self, name, description): + self.name = name self.description = description def pos(self): @@ -12,7 +13,4 @@ class Phase(object): return self.pos() - other.pos() def __str__(self): - return '{name}'.format(name=self.__class__.__name__) - - def __repr__(self): - return self.__str__() + return self.name diff --git a/base/task.py b/base/task.py index 4da8ad3..c3841a6 100644 --- a/base/task.py +++ b/base/task.py @@ -21,12 +21,12 @@ class Task(object): for task in self.before: if self.phase > task.phase: msg = ("The task {self} is specified as running before {other}, " - "but its phase {phase} lies after the phase {other_phase}" + "but its phase '{phase}' lies after the phase '{other_phase}'" .format(self=type(self), other=task, phase=self.phase, other_phase=task.phase)) raise TaskListError(msg) for task in self.after: if self.phase < task.phase: msg = ("The task {self} is specified as running after {other}, " - "but its phase {phase} lies before the phase {other_phase}" + "but its phase '{phase}' lies before the phase '{other_phase}'" .format(self=type(self), other=task, phase=self.phase, other_phase=task.phase)) raise TaskListError(msg) diff --git a/common/phases.py b/common/phases.py index 9f77774..3b44eb2 100644 --- a/common/phases.py +++ b/common/phases.py @@ -1,15 +1,15 @@ from base import Phase -preparation = Phase('Initializing connections, fetching data etc.') -volume_creation = Phase('Creating the volume to bootstrap onto') -volume_preparation = Phase('Formatting the bootstrap volume') -volume_mounting = Phase('Mounting bootstrap volume') -os_installation = Phase('Installing the operating system') -system_modification = Phase('Installing software, modifying configuration files etc.') -system_cleaning = Phase('Removing sensitive data, temporary files and other leftovers') -volume_unmounting = Phase('Unmounting the bootstrap volume') -image_registration = Phase('Uploading/Registering with the provider') -cleaning = Phase('Removing temporary files') +preparation = Phase('Preparation', 'Initializing connections, fetching data etc.') +volume_creation = Phase('Volume creation', 'Creating the volume to bootstrap onto') +volume_preparation = Phase('Volume preparation', 'Formatting the bootstrap volume') +volume_mounting = Phase('Volume mounting', 'Mounting bootstrap volume') +os_installation = Phase('OS installation', 'Installing the operating system') +system_modification = Phase('System modification', 'Installing software, modifying configuration files etc.') +system_cleaning = Phase('System cleaning', 'Removing sensitive data, temporary files and other leftovers') +volume_unmounting = Phase('Volume unmounting', 'Unmounting the bootstrap volume') +image_registration = Phase('Image registration', 'Uploading/Registering with the provider') +cleaning = Phase('Cleaning', 'Removing temporary files') order = [preparation, volume_creation,