mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
sprinkle some newlines around
This commit is contained in:
parent
4180f16656
commit
eec41422fc
4 changed files with 13 additions and 7 deletions
|
@ -30,7 +30,8 @@ class AptUpgrade(Task):
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
rc_policy_path = os.path.join(info.root, 'usr/sbin/policy-rc.d')
|
rc_policy_path = os.path.join(info.root, 'usr/sbin/policy-rc.d')
|
||||||
with open(rc_policy_path, 'w') as rc_policy:
|
with open(rc_policy_path, 'w') as rc_policy:
|
||||||
rc_policy.write('#!/bin/sh\nexit 101')
|
rc_policy.write(('#!/bin/sh\n'
|
||||||
|
'exit 101'))
|
||||||
import stat
|
import stat
|
||||||
os.chmod(rc_policy_path,
|
os.chmod(rc_policy_path,
|
||||||
stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
|
stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
|
||||||
|
|
|
@ -28,7 +28,8 @@ class ConfigureGrub(Task):
|
||||||
|
|
||||||
from common.tools import sed_i
|
from common.tools import sed_i
|
||||||
grub_def = os.path.join(info.root, 'etc/default/grub')
|
grub_def = os.path.join(info.root, 'etc/default/grub')
|
||||||
sed_i(grub_def, '^GRUB_TIMEOUT=[0-9]+', 'GRUB_TIMEOUT=0\nGRUB_HIDDEN_TIMEOUT=true')
|
sed_i(grub_def, '^GRUB_TIMEOUT=[0-9]+', 'GRUB_TIMEOUT=0\n'
|
||||||
|
'GRUB_HIDDEN_TIMEOUT=true')
|
||||||
|
|
||||||
from common.tools import log_check_call
|
from common.tools import log_check_call
|
||||||
log_check_call(['chroot', info.root, 'update-grub'])
|
log_check_call(['chroot', info.root, 'update-grub'])
|
||||||
|
@ -42,7 +43,8 @@ class BlackListModules(Task):
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
blacklist_path = os.path.join(info.root, 'etc/modprobe.d/blacklist.conf')
|
blacklist_path = os.path.join(info.root, 'etc/modprobe.d/blacklist.conf')
|
||||||
with open(blacklist_path, 'a') as blacklist:
|
with open(blacklist_path, 'a') as blacklist:
|
||||||
blacklist.write('# disable pc speaker\nblacklist pcspkr')
|
blacklist.write(('# disable pc speaker\n'
|
||||||
|
'blacklist pcspkr'))
|
||||||
|
|
||||||
|
|
||||||
class DisableGetTTYs(Task):
|
class DisableGetTTYs(Task):
|
||||||
|
|
|
@ -120,6 +120,6 @@ class ModifyFstab(Task):
|
||||||
mount_opts.append('nobarrier')
|
mount_opts.append('nobarrier')
|
||||||
fstab_path = os.path.join(info.root, 'etc/fstab')
|
fstab_path = os.path.join(info.root, 'etc/fstab')
|
||||||
with open(fstab_path, 'a') as fstab:
|
with open(fstab_path, 'a') as fstab:
|
||||||
fstab.write(('/dev/xvda1 / {filesystem} {mount_opts} 1 1'
|
fstab.write(('/dev/xvda1 / {filesystem} {mount_opts} 1 1\n'
|
||||||
.format(filesystem=info.manifest.volume['filesystem'].lower(),
|
.format(filesystem=info.manifest.volume['filesystem'].lower(),
|
||||||
mount_opts=','.join(mount_opts))))
|
mount_opts=','.join(mount_opts))))
|
||||||
|
|
|
@ -18,9 +18,12 @@ class ConfigureNetworkIF(Task):
|
||||||
|
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
interfaces_path = os.path.join(info.root, 'etc/network/interfaces')
|
interfaces_path = os.path.join(info.root, 'etc/network/interfaces')
|
||||||
if_config = {'squeeze': ('auto lo\niface lo inet loopback\n'
|
if_config = {'squeeze': ('auto lo\n'
|
||||||
'auto eth0\niface eth0 inet dhcp'),
|
'iface lo inet loopback\n'
|
||||||
'wheezy': 'auto eth0\niface eth0 inet dhcp'}
|
'auto eth0\n'
|
||||||
|
'iface eth0 inet dhcp\n'),
|
||||||
|
'wheezy': 'auto eth0\n'
|
||||||
|
'iface eth0 inet dhcp\n'}
|
||||||
with open(interfaces_path, 'a') as interfaces:
|
with open(interfaces_path, 'a') as interfaces:
|
||||||
interfaces.write(if_config.get(info.manifest.system['release']))
|
interfaces.write(if_config.get(info.manifest.system['release']))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue