You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2018/05/16 22:45:08 UTC
[incubator-openwhisk] branch master updated: Allow for init to
specify if artifact should be treated as binary regardless of extension.
(#3665)
This is an automated email from the ASF dual-hosted git repository.
csantanapr 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 ed71ee0 Allow for init to specify if artifact should be treated as binary regardless of extension. (#3665)
ed71ee0 is described below
commit ed71ee0cb0dd72eaf1166d0380e2ce2a75f5a9e0
Author: rodric rabbah <ro...@gmail.com>
AuthorDate: Wed May 16 18:45:03 2018 -0400
Allow for init to specify if artifact should be treated as binary regardless of extension. (#3665)
---
actionRuntimes/actionProxy/invoke.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/actionRuntimes/actionProxy/invoke.py b/actionRuntimes/actionProxy/invoke.py
index fb5b72e..68b2ca8 100755
--- a/actionRuntimes/actionProxy/invoke.py
+++ b/actionRuntimes/actionProxy/invoke.py
@@ -75,6 +75,7 @@ def parseArgs():
subparsers = parser.add_subparsers(title='available commands', dest='cmd')
initmenu = subparsers.add_parser('init', help='initialize container with src or zip/tgz file')
+ initmenu.add_argument('-b', '--binary', help='treat artifact as binary', action='store_true')
initmenu.add_argument('main', nargs='?', default='main', help='name of the "main" entry method for the action')
initmenu.add_argument('artifact', help='a source file or zip/tgz archive')
@@ -89,7 +90,7 @@ def init(args):
main = args.main
artifact = args.artifact
- if artifact and (artifact.endswith('.zip') or artifact.endswith('tgz') or artifact.endswith('jar')):
+ if artifact and (args.binary or artifact.endswith('.zip') or artifact.endswith('tgz') or artifact.endswith('jar')):
with open(artifact, 'rb') as fp:
contents = fp.read()
contents = base64.b64encode(contents)
--
To stop receiving notification emails like this one, please contact
csantanapr@apache.org.