bug-fix: python mimic source method 91/53691/1
authorYang Yu <Gabriel.yuyang@huawei.com>
Sat, 24 Feb 2018 08:48:56 +0000 (16:48 +0800)
committerYu Yang (Gabriel) <Gabriel.yuyang@huawei.com>
Tue, 13 Mar 2018 15:08:00 +0000 (15:08 +0000)
JIRA: BOTTLENECK-222

Details could be referred to the above JIRA ticket

Change-Id: I07d89ee85e18a78d060959cfac5ded82aa83ef32
Signed-off-by: Yang Yu <Gabriel.yuyang@huawei.com>
(cherry picked from commit 7407bfdb64115ee380b205b88b689762b3340621)

utils/env_prepare/stack_prepare.py

index c7dae39..640afa1 100644 (file)
@@ -83,7 +83,9 @@ def _source_file(rc_file):
     p = subprocess.Popen(". %s; env" % rc_file, stdout=subprocess.PIPE,
                          shell=True)
     output = p.communicate()[0]
-    env = dict((line.split('=', 1) for line in output.splitlines()))
+    output_lines = output.splitlines()
+    del output_lines[5]
+    env = dict((line.split('=', 1) for line in output_lines))
     os.environ.update(env)
     return env