mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-11 17:40:29 +00:00
PEP8 fixes
This commit is contained in:
parent
2e5d291b9c
commit
51a3e488e3
9 changed files with 14 additions and 18 deletions
|
@ -30,5 +30,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 *
|
|
|
@ -26,11 +26,11 @@ class AddDefaultSources(Task):
|
||||||
sections = 'main'
|
sections = 'main'
|
||||||
if 'sections' in info.manifest.system:
|
if 'sections' in info.manifest.system:
|
||||||
sections = ' '.join(info.manifest.system['sections'])
|
sections = ' '.join(info.manifest.system['sections'])
|
||||||
info.source_lists.add('main', 'deb {apt_mirror} {system.release} '+sections)
|
info.source_lists.add('main', 'deb {apt_mirror} {system.release} ' + sections)
|
||||||
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} '+sections)
|
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} ' + sections)
|
||||||
if info.release_codename != 'sid':
|
if info.release_codename != 'sid':
|
||||||
info.source_lists.add('main', 'deb http://security.debian.org/ {system.release}/updates '+sections)
|
info.source_lists.add('main', 'deb http://security.debian.org/ {system.release}/updates ' + sections)
|
||||||
info.source_lists.add('main', 'deb-src http://security.debian.org/ {system.release}/updates '+sections)
|
info.source_lists.add('main', 'deb-src http://security.debian.org/ {system.release}/updates ' + sections)
|
||||||
info.source_lists.add('main', 'deb {apt_mirror} {system.release}-updates ' + sections)
|
info.source_lists.add('main', 'deb {apt_mirror} {system.release}-updates ' + sections)
|
||||||
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates ' + sections)
|
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates ' + sections)
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -70,7 +70,8 @@ def config_get(path, config_path):
|
||||||
config = config.get(key)
|
config = config.get(key)
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def copy_tree(from_path,to_path):
|
|
||||||
|
def copy_tree(from_path, to_path):
|
||||||
from shutil import copy
|
from shutil import copy
|
||||||
import os
|
import os
|
||||||
for abs_prefix, dirs, files in os.walk(from_path):
|
for abs_prefix, dirs, files in os.walk(from_path):
|
||||||
|
@ -86,4 +87,3 @@ def copy_tree(from_path,to_path):
|
||||||
for path in files:
|
for path in files:
|
||||||
copy(os.path.join(abs_prefix, path),
|
copy(os.path.join(abs_prefix, path),
|
||||||
os.path.join(to_path, prefix, path))
|
os.path.join(to_path, prefix, path))
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,7 @@ def resolve_tasks(taskset, manifest):
|
||||||
if manifest.system['release'] in ['wheezy', 'stable']:
|
if manifest.system['release'] in ['wheezy', 'stable']:
|
||||||
taskset.add(tasks.AddBackports)
|
taskset.add(tasks.AddBackports)
|
||||||
|
|
||||||
taskset.update([ tasks.SetMetadataSource,
|
taskset.update([tasks.SetMetadataSource, tasks.AddCloudInitPackages])
|
||||||
tasks.AddCloudInitPackages,
|
|
||||||
])
|
|
||||||
|
|
||||||
options = manifest.plugins['cloud_init']
|
options = manifest.plugins['cloud_init']
|
||||||
if 'username' in options:
|
if 'username' in options:
|
||||||
|
|
|
@ -5,4 +5,3 @@ def resolve_tasks(taskset, manifest):
|
||||||
if manifest.system['release'] in ['wheezy', 'stable']:
|
if manifest.system['release'] in ['wheezy', 'stable']:
|
||||||
taskset.add(tasks.AddBackports)
|
taskset.add(tasks.AddBackports)
|
||||||
taskset.update([tasks.AddONEContextPackage])
|
taskset.update([tasks.AddONEContextPackage])
|
||||||
|
|
||||||
|
|
|
@ -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):
|
||||||
|
@ -18,6 +17,7 @@ class AddBackports(Task):
|
||||||
info.source_lists.add('backports', 'deb {apt_mirror} {system.release}-backports main')
|
info.source_lists.add('backports', 'deb {apt_mirror} {system.release}-backports main')
|
||||||
info.source_lists.add('backports', 'deb-src {apt_mirror} {system.release}-backports main')
|
info.source_lists.add('backports', 'deb-src {apt_mirror} {system.release}-backports main')
|
||||||
|
|
||||||
|
|
||||||
class AddONEContextPackage(Task):
|
class AddONEContextPackage(Task):
|
||||||
description = 'Adding the OpenNebula context package'
|
description = 'Adding the OpenNebula context package'
|
||||||
phase = phases.preparation
|
phase = phases.preparation
|
||||||
|
|
|
@ -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), '')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue