mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
PEP8 fixes
This commit is contained in:
parent
014e230221
commit
47997b4b13
10 changed files with 29 additions and 37 deletions
|
@ -31,5 +31,5 @@ def load_volume(data, bootloader):
|
||||||
'vmdk': VirtualMachineDisk,
|
'vmdk': VirtualMachineDisk,
|
||||||
'ebs': EBSVolume
|
'ebs': EBSVolume
|
||||||
}
|
}
|
||||||
# Create the volume with the partition map as an argument
|
# Create the volume with the partition map as an argument
|
||||||
return volume_backings.get(data['backing'])(partition_map)
|
return volume_backings.get(data['backing'])(partition_map)
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
from exceptions import *
|
|
|
@ -144,10 +144,10 @@ class FStab(Task):
|
||||||
import os.path
|
import os.path
|
||||||
p_map = info.volume.partition_map
|
p_map = info.volume.partition_map
|
||||||
mount_points = [{'path': '/',
|
mount_points = [{'path': '/',
|
||||||
'partition': p_map.root,
|
'partition': p_map.root,
|
||||||
'dump': '1',
|
'dump': '1',
|
||||||
'pass_num': '1',
|
'pass_num': '1',
|
||||||
}]
|
}]
|
||||||
if hasattr(p_map, 'boot'):
|
if hasattr(p_map, 'boot'):
|
||||||
mount_points.append({'path': '/boot',
|
mount_points.append({'path': '/boot',
|
||||||
'partition': p_map.boot,
|
'partition': p_map.boot,
|
||||||
|
|
|
@ -52,9 +52,8 @@ class SetUsername(Task):
|
||||||
|
|
||||||
class SetMetadataSource(Task):
|
class SetMetadataSource(Task):
|
||||||
description = 'Setting metadata source'
|
description = 'Setting metadata source'
|
||||||
#phase = phases.system_modification
|
|
||||||
phase = phases.package_installation
|
phase = phases.package_installation
|
||||||
successors = [apt.AptUpdate]
|
successors = [apt.AptUpdate]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
from bootstrapvz.base import Task
|
from bootstrapvz.base import Task
|
||||||
from bootstrapvz.common.tasks import apt
|
from bootstrapvz.common.tasks import apt
|
||||||
from bootstrapvz.common import phases
|
from bootstrapvz.common import phases
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
class AddBackports(Task):
|
class AddBackports(Task):
|
||||||
|
|
|
@ -2,6 +2,7 @@ from bootstrapvz.base import Task
|
||||||
from bootstrapvz.common import phases
|
from bootstrapvz.common import phases
|
||||||
from bootstrapvz.common.tasks import apt
|
from bootstrapvz.common.tasks import apt
|
||||||
from bootstrapvz.common.tasks import network
|
from bootstrapvz.common.tasks import network
|
||||||
|
from bootstrapvz.common.tools import sed_i
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,7 +83,6 @@ class ApplyPuppetManifest(Task):
|
||||||
'puppet', 'apply', manifest_path])
|
'puppet', 'apply', manifest_path])
|
||||||
os.remove(manifest_dst)
|
os.remove(manifest_dst)
|
||||||
|
|
||||||
from bootstrapvz.common.tools import sed_i
|
|
||||||
hosts_path = os.path.join(info.root, 'etc/hosts')
|
hosts_path = os.path.join(info.root, 'etc/hosts')
|
||||||
sed_i(hosts_path, '127.0.0.1\s*{hostname}\n?'.format(hostname=hostname), '')
|
sed_i(hosts_path, '127.0.0.1\s*{hostname}\n?'.format(hostname=hostname), '')
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ def validate_manifest(data, validator, error):
|
||||||
def resolve_tasks(taskset, manifest):
|
def resolve_tasks(taskset, manifest):
|
||||||
from bootstrapvz.common.tasks import security
|
from bootstrapvz.common.tasks import security
|
||||||
from bootstrapvz.common.tasks import loopback
|
from bootstrapvz.common.tasks import loopback
|
||||||
from bootstrapvz.common.tasks import network
|
|
||||||
taskset.discard(security.DisableSSHPasswordAuthentication)
|
taskset.discard(security.DisableSSHPasswordAuthentication)
|
||||||
taskset.discard(loopback.MoveImage)
|
taskset.discard(loopback.MoveImage)
|
||||||
|
|
||||||
|
|
|
@ -45,18 +45,18 @@ def resolve_tasks(taskset, manifest):
|
||||||
taskset.add(network.RemoveHostname)
|
taskset.add(network.RemoveHostname)
|
||||||
|
|
||||||
taskset.update([tasks.packages.DefaultPackages,
|
taskset.update([tasks.packages.DefaultPackages,
|
||||||
loopback.Create,
|
loopback.Create,
|
||||||
security.EnableShadowConfig,
|
security.EnableShadowConfig,
|
||||||
network.RemoveDNSInfo,
|
network.RemoveDNSInfo,
|
||||||
network.ConfigureNetworkIF,
|
network.ConfigureNetworkIF,
|
||||||
initd.AddSSHKeyGeneration,
|
initd.AddSSHKeyGeneration,
|
||||||
initd.InstallInitScripts,
|
initd.InstallInitScripts,
|
||||||
tasks.packages.Waagent,
|
tasks.packages.Waagent,
|
||||||
tasks.boot.ConfigureGrub,
|
tasks.boot.ConfigureGrub,
|
||||||
cleanup.ClearMOTD,
|
cleanup.ClearMOTD,
|
||||||
cleanup.CleanTMP,
|
cleanup.CleanTMP,
|
||||||
tasks.image.ConvertToVhd,
|
tasks.image.ConvertToVhd,
|
||||||
])
|
])
|
||||||
|
|
||||||
if manifest.bootstrapper.get('tarball', False):
|
if manifest.bootstrapper.get('tarball', False):
|
||||||
taskset.add(bootstrap.MakeTarball)
|
taskset.add(bootstrap.MakeTarball)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from bootstrapvz.base import Task
|
from bootstrapvz.base import Task
|
||||||
from bootstrapvz.common import phases
|
from bootstrapvz.common import phases
|
||||||
from bootstrapvz.common.tasks import loopback
|
|
||||||
|
|
||||||
|
|
||||||
class ConvertToVhd(Task):
|
class ConvertToVhd(Task):
|
||||||
|
|
|
@ -43,19 +43,16 @@ def resolve_tasks(taskset, manifest):
|
||||||
taskset.add(network.RemoveHostname)
|
taskset.add(network.RemoveHostname)
|
||||||
|
|
||||||
taskset.update([tasks.packages.DefaultPackages,
|
taskset.update([tasks.packages.DefaultPackages,
|
||||||
|
loopback.Create,
|
||||||
loopback.Create,
|
security.EnableShadowConfig,
|
||||||
|
network.RemoveDNSInfo,
|
||||||
security.EnableShadowConfig,
|
network.ConfigureNetworkIF,
|
||||||
network.RemoveDNSInfo,
|
initd.AddSSHKeyGeneration,
|
||||||
network.ConfigureNetworkIF,
|
initd.InstallInitScripts,
|
||||||
initd.AddSSHKeyGeneration,
|
cleanup.ClearMOTD,
|
||||||
initd.InstallInitScripts,
|
cleanup.CleanTMP,
|
||||||
cleanup.ClearMOTD,
|
loopback.MoveImage,
|
||||||
cleanup.CleanTMP,
|
])
|
||||||
|
|
||||||
loopback.MoveImage,
|
|
||||||
])
|
|
||||||
|
|
||||||
if manifest.bootstrapper.get('tarball', False):
|
if manifest.bootstrapper.get('tarball', False):
|
||||||
taskset.add(bootstrap.MakeTarball)
|
taskset.add(bootstrap.MakeTarball)
|
||||||
|
|
Loading…
Add table
Reference in a new issue