mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Move host task to common tasks
This commit is contained in:
parent
15e59ab2c8
commit
1b329d1082
4 changed files with 3 additions and 30 deletions
|
@ -18,12 +18,3 @@ class CheckPackages(Task):
|
||||||
except CalledProcessError:
|
except CalledProcessError:
|
||||||
msg = "The package ``{0}\'\' is not installed".format(package)
|
msg = "The package ``{0}\'\' is not installed".format(package)
|
||||||
raise TaskError(msg)
|
raise TaskError(msg)
|
||||||
|
|
||||||
|
|
||||||
class GetInfo(Task):
|
|
||||||
description = 'Retrieving instance metadata'
|
|
||||||
phase = phases.preparation
|
|
||||||
|
|
||||||
def run(self, info):
|
|
||||||
info.host = {}
|
|
||||||
return info
|
|
|
@ -3,6 +3,7 @@ import logging
|
||||||
from tasks import packages
|
from tasks import packages
|
||||||
from tasks import connection
|
from tasks import connection
|
||||||
from tasks import host
|
from tasks import host
|
||||||
|
from common.tasks import host as common_host
|
||||||
from tasks import ami
|
from tasks import ami
|
||||||
from tasks import ebs
|
from tasks import ebs
|
||||||
from common.tasks import loopback
|
from common.tasks import loopback
|
||||||
|
@ -27,7 +28,7 @@ def initialize():
|
||||||
def tasks(tasklist, manifest):
|
def tasks(tasklist, manifest):
|
||||||
tasklist.add(packages.HostPackages(),
|
tasklist.add(packages.HostPackages(),
|
||||||
packages.ImagePackages(),
|
packages.ImagePackages(),
|
||||||
host.CheckPackages(),
|
common_host.CheckPackages(),
|
||||||
connection.GetCredentials(),
|
connection.GetCredentials(),
|
||||||
host.GetInfo(),
|
host.GetInfo(),
|
||||||
ami.AMIName(),
|
ami.AMIName(),
|
||||||
|
|
|
@ -1,23 +1,5 @@
|
||||||
from base import Task
|
from base import Task
|
||||||
from common import phases
|
from common import phases
|
||||||
from common.exceptions import TaskError
|
|
||||||
import packages
|
|
||||||
|
|
||||||
|
|
||||||
class CheckPackages(Task):
|
|
||||||
description = 'Checking installed host packages'
|
|
||||||
phase = phases.preparation
|
|
||||||
after = [packages.HostPackages, packages.ImagePackages]
|
|
||||||
|
|
||||||
def run(self, info):
|
|
||||||
from common.tools import log_check_call
|
|
||||||
from subprocess import CalledProcessError
|
|
||||||
for package in info.host_packages:
|
|
||||||
try:
|
|
||||||
log_check_call(['/usr/bin/dpkg', '-s', package])
|
|
||||||
except CalledProcessError:
|
|
||||||
msg = "The package ``{0}\'\' is not installed".format(package)
|
|
||||||
raise TaskError(msg)
|
|
||||||
|
|
||||||
|
|
||||||
class GetInfo(Task):
|
class GetInfo(Task):
|
||||||
|
|
|
@ -20,8 +20,7 @@ def initialize():
|
||||||
def tasks(tasklist, manifest):
|
def tasks(tasklist, manifest):
|
||||||
tasklist.add(packages.HostPackages(),
|
tasklist.add(packages.HostPackages(),
|
||||||
packages.ImagePackages(),
|
packages.ImagePackages(),
|
||||||
host.CheckPackages(),
|
host.CheckPackages())
|
||||||
host.GetInfo())
|
|
||||||
tasklist.add(filesystem.FormatVolume())
|
tasklist.add(filesystem.FormatVolume())
|
||||||
if manifest.volume['filesystem'].lower() == 'xfs':
|
if manifest.volume['filesystem'].lower() == 'xfs':
|
||||||
tasklist.add(filesystem.AddXFSProgs())
|
tasklist.add(filesystem.AddXFSProgs())
|
||||||
|
|
Loading…
Add table
Reference in a new issue