Merge "ci/deploy.sh: Add new `-E` arg for env erase" into stable/euphrates
[fuel.git] / mcp / patches / pharos / 0002-PDF-generate_config-Fix-abspath-for-j-arg.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2017 Mirantis Inc., Enea AB and others.
3 :
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
10 Date: Tue, 17 Oct 2017 18:21:07 +0200
11 Subject: [PATCH] PDF: generate_config: Fix abspath for '-j' arg
12
13 Change-Id: I8a9076e7965bfd2bee7d298eb8e3b11e62ae66e7
14 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
15 ---
16  config/utils/generate_config.py | 4 ++--
17  1 file changed, 2 insertions(+), 2 deletions(-)
18
19 diff --git a/config/utils/generate_config.py b/config/utils/generate_config.py
20 index 18af98d..22a27d3 100755
21 --- a/config/utils/generate_config.py
22 +++ b/config/utils/generate_config.py
23 @@ -38,7 +38,7 @@ def dpkg_arch(arch, to_dpkg=True):
24      else:
25          return ARCH_DPKG_TABLE[arch]
26
27 -ENV = Environment(loader=FileSystemLoader('./'))
28 +ENV = Environment(loader=FileSystemLoader(os.path.dirname(ARGS.jinja2)))
29  ENV.filters['ipaddr_index'] = ipaddr_index
30  ENV.filters['dpkg_arch'] = dpkg_arch
31
32 @@ -56,6 +56,6 @@ if os.path.exists(IDF_PATH):
33  # print(DICT)
34
35  # Render template and print generated conf to console
36 -TEMPLATE = ENV.get_template(ARGS.jinja2)
37 +TEMPLATE = ENV.get_template(os.path.basename(ARGS.jinja2))
38  #pylint: disable=superfluous-parens
39  print(TEMPLATE.render(conf=DICT))