Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.

Commit 74a1ca0

Browse files
author
OpenShift Bot
committed
Merge pull request #6270 from Miciah/set_connection_hook_env_vars-log-errs-write_environment_variables-skip-bad-lines
Merged by openshift-bot
2 parents 123da46 + 1562eca commit 74a1ca0

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

node/lib/openshift-origin-node/model/v2_cart_model.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,13 @@ def write_environment_variables(path, hash, prefix = true)
720720
name = "OPENSHIFT_#{name}"
721721
end
722722

723-
File.open(PathUtils.join(path, name), 'w', 0666) do |f|
724-
f.write(v)
723+
pathname = PathUtils.join(path, name)
724+
begin
725+
File.open(pathname, 'w', 0666) do |f|
726+
f.write(v)
727+
end
728+
rescue Exception => e
729+
logger.warn "Got #{e.class} exception writing #{pathname}: #{e.message}"
725730
end
726731
end
727732
end
@@ -1222,6 +1227,8 @@ def set_connection_hook_env_vars(cart_name, pub_cart_name, args)
12221227
pairs = args[3].values[0].split("\n")
12231228

12241229
pairs.each do |pair|
1230+
next if not pair.include? '='
1231+
12251232
k, v = pair.strip.split("=")
12261233
envs[k] = v
12271234
end

0 commit comments

Comments
 (0)