This is an automated email from the ASF dual-hosted git repository.
rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git
The following commit(s) were added to refs/heads/master by this push:
new 45d4325 Fix potential resource leak in Wsk.scala (#2610)
45d4325 is described below
commit 45d4325072c5bc261f5cd375980476ca0d5d85cb
Author: Sayat <[email protected]>
AuthorDate: Thu Aug 17 04:18:40 2017 +0200
Fix potential resource leak in Wsk.scala (#2610)
---
tests/src/test/scala/common/Wsk.scala | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/src/test/scala/common/Wsk.scala
b/tests/src/test/scala/common/Wsk.scala
index 8b1ad6c..c648d9f 100644
--- a/tests/src/test/scala/common/Wsk.scala
+++ b/tests/src/test/scala/common/Wsk.scala
@@ -79,10 +79,13 @@ case class WskProps(
token: String = "") {
def overrides = Seq("-i", "--apihost", apihost, "--apiversion", apiversion)
def writeFile(propsfile: File) = {
- val propsStr =
s"NAMESPACE=${namespace}\nAPIVERSION=${apiversion}\nAUTH=${authKey}\nAPIHOST=${apihost}\nAPIGW_ACCESS_TOKEN=${token}\n"
+ val propsStr =
s"NAMESPACE=$namespace\nAPIVERSION=$apiversion\nAUTH=$authKey\nAPIHOST=$apihost\nAPIGW_ACCESS_TOKEN=$token\n"
val bw = new BufferedWriter(new FileWriter(propsfile))
- bw.write(propsStr)
- bw.close()
+ try {
+ bw.write(propsStr)
+ } finally {
+ bw.close()
+ }
}
}
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].