From 954b1d76fcc972c631d916626687436403f9783b Mon Sep 17 00:00:00 2001 From: Ryan Harper Date: Thu, 8 Oct 2015 15:12:07 -0500 Subject: [PATCH] Drop jinja2 use We no longer use the jinja2 template file. Drop its use and the deps. Signed-off-by: Ryan Harper --- Makefile | 2 +- subiquity/curtin.py | 71 --------------------------------------------- 2 files changed, 1 insertion(+), 72 deletions(-) diff --git a/Makefile b/Makefile index 70076777..39b8904f 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ install_deps_amd64: sudo apt-get install grub-efi-amd64-signed install_deps: install_deps_$(ARCH) - sudo apt-get install python3-urwid python3-pyudev python3-netifaces python3-nose python3-flake8 python3-yaml git bzr ubuntu-cloudimage-keyring python3-jinja2 python3-coverage ovmf shim shim-signed + sudo apt-get install python3-urwid python3-pyudev python3-netifaces python3-nose python3-flake8 python3-yaml git bzr ubuntu-cloudimage-keyring python3-coverage ovmf shim shim-signed dryrun: probert $(MAKE) ui-view DRYRUN="--dry-run --uefi" diff --git a/subiquity/curtin.py b/subiquity/curtin.py index caba9347..ca28e24c 100644 --- a/subiquity/curtin.py +++ b/subiquity/curtin.py @@ -14,7 +14,6 @@ # along with this program. If not, see . import datetime -import jinja2 import logging import os import subprocess @@ -62,52 +61,6 @@ network: version: 1 config: """ -CURTIN_STORAGE_CONFIG_TEMPLATE = """ -# Autogenerated by SUbiquity: {{DATE}} UTC -reporter: - subiquity: - path: /tmp/curtin_progress_subiquity - progress: True - -partitioning_commands: - builtin: curtin block-meta custom - -storage: - version: 1 - config: - - id: {{TARGET_DISK_NAME}} - type: disk - ptable: msdos - model: {{TARGET_DISK_MODEL}} - serial: {{TARGET_DISK_SERIAL}} - - id: {{TARGET_DISK_NAME}}1 - type: partition - offset: 512MB - size: 8GB - device: {{TARGET_DISK_NAME}} - flag: boot - - id: {{TARGET_DISK_NAME}}2 - type: partition - offset: 8512MB - size: 1GB - device: {{TARGET_DISK_NAME}} - - id: {{TARGET_DISK_NAME}}1_root - type: format - fstype: ext4 - volume: {{TARGET_DISK_NAME}}1 - - id: {{TARGET_DISK_NAME}}2_home - type: format - fstype: ext4 - volume: {{TARGET_DISK_NAME}}2 - - id: {{TARGET_DISK_NAME}}1_mount - type: mount - path: / - device: {{TARGET_DISK_NAME}}1_root - - id: {{TARGET_DISK_NAME}}2_mount - type: mount - path: /home - device: {{TARGET_DISK_NAME}}2_home -""" # TODO, this should be moved to the in-target cloud-config seed so on first boot # of the target, it reconfigures datasource_list to none for subsequent boots @@ -166,30 +119,6 @@ def curtin_write_network_actions(actions): conf.close() -def curtin_write_storage_template(disk_name, disk_model, disk_serial): - ''' write out the storage yaml template for curtin - params: - disk_name: kernel name of disk (/dev/sda) - disk_model: disk model name - disk_serial: serial of disk from probert storage output - ''' - template = jinja2.Template(CURTIN_STORAGE_CONFIG_TEMPLATE, - undefined=jinja2.StrictUndefined) - - ctxt = { - 'DATE': str(datetime.datetime.utcnow()), - 'TARGET_DISK_NAME': os.path.basename(disk_name), - 'TARGET_DISK_MODEL': disk_model, - 'TARGET_DISK_SERIAL': disk_serial, - } - curtin_config = template.render(ctxt) - with open(CURTIN_STORAGE_CONFIG_FILE, 'w') as conf: - conf.write(curtin_config) - conf.close() - - return CURTIN_STORAGE_CONFIG_FILE - - def curtin_write_preserved_actions(actions): ''' caller must use models.actions.preserve_action on all elements of the actions'''