From 9e0c55a7acb1d24dc6e8b7d8a1e3faa06c4cc344 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Mon, 5 Mar 2018 15:48:57 -0500 Subject: [PATCH] Delete rendered nic configs during --clean Also delete the newly rendered per-role sample nic config templates when process-templates.py is called with --clean. Change-Id: Ic77b3c9e243839201065260b5807d145c4bb9972 --- tools/process-templates.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/process-templates.py b/tools/process-templates.py index 39622864d3..a0b73df775 100755 --- a/tools/process-templates.py +++ b/tools/process-templates.py @@ -311,6 +311,16 @@ def clean_templates(base_path, role_data_path, network_data_path): delete(role_path) delete(host_config_and_reboot_path) + nic_config_dir = os.path.join(base_path, 'network', 'config') + for sample_nic_config_dir in os.listdir(nic_config_dir): + delete(os.path.join( + nic_config_dir, sample_nic_config_dir, + '%s.yaml' % role['name'].lower())) + delete(os.path.join( + nic_config_dir, sample_nic_config_dir, + role['deprecated_nic_config_name'])) + + opts = parse_opts(sys.argv) role_data_path = os.path.join(opts.base_path, opts.roles_data)