代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/cloud-init 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 224da46b2331b582577b86c3eb707f67d57800fb Mon Sep 17 00:00:00 2001
From: chengquan <chengquan3@huawei.com>
Date: Thu, 8 Aug 2019 16:15:31 +0800
Subject: [PATCH] cloud-init: add variable to forbid tmp dir
reason: add variable to forbid temporary directory
Signed-off-by: chengquan <chengquan3@huawei.com>
---
setup.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/setup.py b/setup.py
index c3659cc..b4847ac 100644
--- a/setup.py
+++ b/setup.py
@@ -49,6 +49,8 @@ RENDERED_TMPD_PREFIX = "RENDERED_TEMPD"
VARIANT = None
PREFIX = None
+# add variable to forbid tmp dir
+num = 0
def render_tmpl(template, mode=None, is_yaml=False):
"""render template into a tmpdir under same dir as setup.py
@@ -69,7 +71,10 @@ def render_tmpl(template, mode=None, is_yaml=False):
return template
topdir = os.path.dirname(sys.argv[0])
- tmpd = tempfile.mkdtemp(dir=topdir, prefix=RENDERED_TMPD_PREFIX)
+ global num
+ os.mkdir(topdir + str(num))
+ tmpd = os.path.abspath(topdir + str(num))
+ num = num + 1
atexit.register(shutil.rmtree, tmpd)
bname = os.path.basename(template)
ename, ext = os.path.splitext(bname)
@@ -99,6 +104,10 @@ def render_tmpl(template, mode=None, is_yaml=False):
return os.path.join(os.path.basename(tmpd), bname)
+def sort_files(file_list):
+ file_list.sort()
+ return file_list
+
# User can set the variant for template rendering
for a in sys.argv:
if a.startswith("--distro"):
@@ -139,11 +148,11 @@ INITSYS_FILES = {
"systemd": lambda: [
render_tmpl(f)
for f in (
- glob("systemd/*.tmpl")
+ sort_files((glob('systemd/*.tmpl')
+ glob("systemd/*.service")
+ glob("systemd/*.socket")
+ glob("systemd/*.target")
- )
+ )))
if (is_f(f) and not is_generator(f))
],
"systemd.generators": lambda: [
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。