From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org, lijuan.tu@intel.com
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V1 1/1] framework/rst: fix syntax error
Date: Fri, 18 Oct 2019 16:06:03 +0800 [thread overview]
Message-ID: <20191018080603.60616-2-yufengx.mo@intel.com> (raw)
In-Reply-To: <20191018080603.60616-1-yufengx.mo@intel.com>
It should check rst folder existence before run os.mkdir. When rst folder exists, old source code will raise exception.
Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
framework/rst.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/framework/rst.py b/framework/rst.py
index 2f36ab1..9179a09 100644
--- a/framework/rst.py
+++ b/framework/rst.py
@@ -68,7 +68,10 @@ class RstReport(object):
for node in range(0, len(path)):
if not os.path.exists('/'.join(path[:node + 1])):
for level in range(node, len(path)):
- os.mkdir('/'.join(path[:level + 1]))
+ rst_folder = '/'.join(path[:level + 1])
+ if os.path.exists(rst_folder):
+ continue
+ os.mkdir(rst_folder)
break
self.rstName = "%s/TestResult_%s.rst" % ('/'.join(path), suite)
--
2.21.0
prev parent reply other threads:[~2019-10-18 8:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-18 8:06 [dts] [PATCH V1 0/1] framework/rst: fix syntax issue yufengmx
2019-10-18 8:06 ` yufengmx [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191018080603.60616-2-yufengx.mo@intel.com \
--to=yufengx.mo@intel.com \
--cc=dts@dpdk.org \
--cc=lijuan.tu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).