mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Cosmetic changes in azure provider
This commit is contained in:
parent
9e748601b3
commit
9e20731c84
3 changed files with 14 additions and 17 deletions
|
@ -2,6 +2,7 @@ from bootstrapvz.base import Task
|
|||
from bootstrapvz.common import phases
|
||||
from bootstrapvz.common.tasks import boot
|
||||
|
||||
|
||||
class ConfigureGrub(Task):
|
||||
description = 'Change grub configuration to allow for ttyS0 output'
|
||||
phase = phases.system_modification
|
||||
|
@ -14,4 +15,3 @@ class ConfigureGrub(Task):
|
|||
grub_config = os.path.join(info.root, 'etc/default/grub')
|
||||
sed_i(grub_config, r'^(GRUB_CMDLINE_LINUX*=".*)"\s*$', r'\1console=ttyS0 earlyprintk=ttyS0 rootdelay=300"')
|
||||
sed_i(grub_config, r'^.*(GRUB_TIMEOUT=).*$', r'GRUB_TIMEOUT=0')
|
||||
|
||||
|
|
|
@ -15,11 +15,14 @@ class ConvertToVhd(Task):
|
|||
destination = os.path.join(info.manifest.bootstrapper['workspace'], filename)
|
||||
|
||||
file_size = os.path.getsize(info.volume.image_path)
|
||||
rounded_vol_size = str(((file_size/(1024*1024)+1)*(1024*1024)))
|
||||
rounded_vol_size = str(((file_size / (1024 * 1024) + 1) * (1024 * 1024)))
|
||||
|
||||
from bootstrapvz.common.tools import log_check_call
|
||||
log_check_call(['qemu-img', 'resize', info.volume.image_path, rounded_vol_size])
|
||||
log_check_call(['qemu-img', 'convert', '-o', 'subformat=fixed', '-O', 'vpc', info.volume.image_path, destination])
|
||||
log_check_call(['qemu-img', 'convert',
|
||||
'-o', 'subformat=fixed',
|
||||
'-O', 'vpc',
|
||||
info.volume.image_path, destination])
|
||||
os.remove(info.volume.image_path)
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
|
|
@ -20,7 +20,7 @@ class DefaultPackages(Task):
|
|||
info.packages.add('python-pyasn1')
|
||||
info.packages.add('git')
|
||||
info.packages.add('sudo')
|
||||
#info.packages.add('waagent')
|
||||
|
||||
|
||||
class Waagent(Task):
|
||||
description = 'Add waagent'
|
||||
|
@ -33,19 +33,13 @@ class Waagent(Task):
|
|||
import os
|
||||
env = os.environ.copy()
|
||||
env['GIT_SSL_NO_VERIFY'] = 'true'
|
||||
status, out, err = log_call(['chroot', info.root,
|
||||
'git','clone', 'https://github.com/WindowsAzure/WALinuxAgent.git',
|
||||
'/root/WALinuxAgent'], env=env)
|
||||
status, out, err = log_call(['chroot', info.root,
|
||||
'cp','/root/WALinuxAgent/waagent','/usr/sbin/waagent'])
|
||||
status, out, err = log_call(['chroot', info.root,
|
||||
'chmod','755','/usr/sbin/waagent'])
|
||||
status, out, err = log_call(['chroot', info.root,
|
||||
'/usr/sbin/waagent','-install'])
|
||||
log_call(['chroot', info.root,
|
||||
'git', 'clone', 'https://github.com/WindowsAzure/WALinuxAgent.git',
|
||||
'/root/WALinuxAgent'], env=env)
|
||||
log_call(['chroot', info.root, 'cp', '/root/WALinuxAgent/waagent', '/usr/sbin/waagent'])
|
||||
log_call(['chmod', '755', '/usr/sbin/waagent'])
|
||||
log_call(['chroot', info.root, 'waagent', '-install'])
|
||||
import os.path
|
||||
if hasattr(info.manifest, 'azure') and info.manifest.azure['waagent']:
|
||||
if os.path.isfile(info.manifest.azure['waagent']):
|
||||
status, out, err = log_call(['cp',
|
||||
info.manifest.azure['waagent'],
|
||||
os.path.join(info.root,'etc/waagent.conf')])
|
||||
|
||||
log_call(['cp', info.manifest.azure['waagent'], os.path.join(info.root, 'etc/waagent.conf')])
|
||||
|
|
Loading…
Add table
Reference in a new issue