You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by vv...@apache.org on 2018/08/14 13:48:30 UTC

[incubator-openwhisk-runtime-ruby] branch master updated: update run handler to accept more environment variables (#10)

This is an automated email from the ASF dual-hosted git repository.

vvraskin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-runtime-ruby.git


The following commit(s) were added to refs/heads/master by this push:
     new 81ad63a  update run handler to accept more environment variables (#10)
81ad63a is described below

commit 81ad63a6c30b540c150ddb3ff4dc2a2bc911ad7f
Author: Carlos Santana <cs...@apache.org>
AuthorDate: Tue Aug 14 09:48:28 2018 -0400

    update run handler to accept more environment variables (#10)
---
 core/ruby2.5Action/rackapp/run.rb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/core/ruby2.5Action/rackapp/run.rb b/core/ruby2.5Action/rackapp/run.rb
index c4699d2..6fdb68d 100644
--- a/core/ruby2.5Action/rackapp/run.rb
+++ b/core/ruby2.5Action/rackapp/run.rb
@@ -14,9 +14,11 @@ class RunApp
     body = Rack::Request.new(env).body.read
     data = JSON.parse(body) || {}
     env = {'BUNDLE_GEMFILE' => PROGRAM_DIR + 'Gemfile'}
-    ['api_key', 'namespace', 'action_name', 'activation_id', 'deadline'].each{|e|
-      env["__OW_#{e.upcase}"] = data[e] if data[e] && data[e].is_a?(String)
-    }
+    data.each do |key, value|
+      if key != 'value'
+        env["__OW_#{key.upcase}"] = value if value && value.is_a?(String)
+      end
+    end
 
     # Save parameter values to file in order to let runner.rb read this later
     File.write PARAM, data['value'].to_json