Commit 63f0bf8e authored by Marco Mariani's avatar Marco Mariani

removed hard tabs

parent 331216b6
...@@ -152,19 +152,19 @@ def run(config): ...@@ -152,19 +152,19 @@ def run(config):
fdisk_output_path = "/tmp/a_generated_file" fdisk_output_path = "/tmp/a_generated_file"
try: try:
if not config.virtual: if not config.virtual:
offset = 0 offset = 0
fdisk_output_file = open(fdisk_output_path, 'w') fdisk_output_file = open(fdisk_output_path, 'w')
_call(['sfdisk', '-d', '-uS', config.system_path], stdout=fdisk_output_file) _call(['sfdisk', '-d', '-uS', config.system_path], stdout=fdisk_output_file)
fdisk_output_file.close() fdisk_output_file.close()
fdisk_output_file = open(fdisk_output_path, 'r') fdisk_output_file = open(fdisk_output_path, 'r')
for line in fdisk_output_file: for line in fdisk_output_file:
line = line.rstrip().replace(' ', '') line = line.rstrip().replace(' ', '')
if line.endswith("bootable"): if line.endswith("bootable"):
offset = int(line.split(':')[1].split(',')[0].split('=')[1]) offset = int(line.split(':')[1].split(',')[0].split('=')[1])
fdisk_output_file.close() fdisk_output_file.close()
offset = offset * 512 offset = offset * 512
_call(['mount', '-o', 'loop,offset=%i' % offset, config.system_path, _call(['mount', '-o', 'loop,offset=%i' % offset, config.system_path,
mount_dir_path], dry_run=dry_run) mount_dir_path], dry_run=dry_run)
# Call vmware-mount to mount Virtual disk image # Call vmware-mount to mount Virtual disk image
else: else:
print "Mount Virtual Image" print "Mount Virtual Image"
...@@ -302,16 +302,16 @@ def run(config): ...@@ -302,16 +302,16 @@ def run(config):
# Adding slapos_firstboot in case of MultiDisk usage # Adding slapos_firstboot in case of MultiDisk usage
if not config.one_disk : if not config.one_disk :
for script in ['slapos_firstboot']: for script in ['slapos_firstboot']:
path = os.path.join(mount_dir_path, 'etc', 'init.d', script) path = os.path.join(mount_dir_path, 'etc', 'init.d', script)
print "Creating %r" % path print "Creating %r" % path
if not dry_run: if not dry_run:
open(path, 'w').write(pkg_resources.resource_stream(__name__, open(path, 'w').write(pkg_resources.resource_stream(__name__,
'script/%s' % script).read()) 'script/%s' % script).read())
os.chmod(path, 0755) os.chmod(path, 0755)
else: else:
for script in ['slapos_firstboot']: for script in ['slapos_firstboot']:
path = os.path.join(mount_dir_path, 'etc', 'init.d', script) path = os.path.join(mount_dir_path, 'etc', 'init.d', script)
if os.path.exists(path): if os.path.exists(path):
print "Removing %r" % path print "Removing %r" % path
os.remove(path) os.remove(path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment