Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 1/2] tools/sppc: fix bug of creating env file
Date: Fri,  9 Nov 2018 16:25:48 +0900	[thread overview]
Message-ID: <1541748349-15538-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1541748349-15538-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

Build script create `env.sh` to activate config of env on the container.
This patch is to fix bug failed to created the file.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 tools/sppc/build/main.py | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/tools/sppc/build/main.py b/tools/sppc/build/main.py
index 9618bab..dcde412 100755
--- a/tools/sppc/build/main.py
+++ b/tools/sppc/build/main.py
@@ -86,9 +86,12 @@ def create_env_sh(dst_dir, rte_sdk, target, target_dir):
     elif target == 'spp':
         contents += "export SPP_DIR=%s" % target_dir
 
-    f = open('%s/env.sh' % dst_dir, 'w')
-    f.write(contents)
-    f.close()
+    try:
+        f = open('%s/env.sh' % dst_dir, 'w')
+        f.write(contents)
+        f.close()
+    except IOError:
+        print('Error: Failed to create env.sh.')
 
 
 def main():
@@ -142,10 +145,12 @@ def main():
     # Check for just creating env.sh, or run docker build.
     if args.only_envsh is True:
         if args.dry_run is False:
-            if target == 'pktgen':
-                create_env_sh(dockerfile_dir, rte_sdk, target, pktgen_dir)
-            elif target == 'spp':
-                create_env_sh(dockerfile_dir, rte_sdk, target, spp_dir)
+            if args.target == 'pktgen':
+                create_env_sh(dockerfile_dir, rte_sdk, args.target, pktgen_dir)
+            elif args.target == 'spp':
+                create_env_sh(dockerfile_dir, rte_sdk, args.target, spp_dir)
+            elif args.target == 'dpdk':
+                create_env_sh(dockerfile_dir, rte_sdk, args.target, dpdk_dir)
             print("Info: '%s/env.sh' created." % dockerfile_dir)
             exit()
         else:
@@ -157,6 +162,8 @@ def main():
             create_env_sh(dockerfile_dir, rte_sdk, args.target, pktgen_dir)
         elif args.target == 'spp':
             create_env_sh(dockerfile_dir, rte_sdk, args.target, spp_dir)
+        elif args.target == 'dpdk':
+            create_env_sh(dockerfile_dir, rte_sdk, args.target, dpdk_dir)
 
     # Setup environment variables on host to pass 'docker build'.
     env_opts = [
-- 
2.7.4

  reply	other threads:[~2018-11-09  7:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-09  7:25 [spp] [PATCH 0/2] Update of SPP Container ogawa.yasufumi
2018-11-09  7:25 ` ogawa.yasufumi [this message]
2018-11-09  7:25 ` [spp] [PATCH 2/2] spp-ctl: change to bind IP address to SPP procs ogawa.yasufumi

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=1541748349-15538-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /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).