bootstrap-vz/common/tasks/workspace.py
Anders Ingemann 0092e1c2c2 Don't instantiate tasks
In practice they are just typed functions with attributes, having a reference to an object is just confusing.
So: Task.run() is now a classmethod
2014-01-06 22:58:21 +01:00

22 lines
388 B
Python

from base import Task
from common import phases
class CreateWorkspace(Task):
description = 'Creating workspace'
phase = phases.preparation
@classmethod
def run(cls, info):
import os
os.makedirs(info.workspace)
class DeleteWorkspace(Task):
description = 'Deleting workspace'
phase = phases.cleaning
@classmethod
def run(cls, info):
import os
os.rmdir(info.workspace)