PEP8 fixes

This commit is contained in:
Tiago Ilieve 2014-04-27 10:14:02 -03:00
parent 2e5d291b9c
commit 51a3e488e3
9 changed files with 14 additions and 18 deletions

View file

@ -1 +0,0 @@
from exceptions import *

View file

@ -70,6 +70,7 @@ 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
@ -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))

View file

@ -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:

View file

@ -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])

View file

@ -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

View file

@ -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), '')