[ARVADOS] updated: 79ee8eac7e5731b27375cc7f06cac109f26287ea
git at public.curoverse.com
git at public.curoverse.com
Wed Jan 8 13:45:48 EST 2014
Summary of changes:
sdk/cli/bin/arv | 12 ++----------
sdk/cli/bin/arv-tag | 40 ++++++++++++++++++++++++----------------
2 files changed, 26 insertions(+), 26 deletions(-)
via 79ee8eac7e5731b27375cc7f06cac109f26287ea (commit)
from 0fa7c220a6f9e0deb220fd3036aa89eb9f2a7599 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 79ee8eac7e5731b27375cc7f06cac109f26287ea
Author: Tim Pierce <twp at curoverse.com>
Date: Wed Jan 8 13:45:38 2014 -0500
Bug fixes.
diff --git a/sdk/cli/bin/arv b/sdk/cli/bin/arv
index 63dfa4f..d4b6f22 100755
--- a/sdk/cli/bin/arv
+++ b/sdk/cli/bin/arv
@@ -20,7 +20,7 @@ if File.exist? config_file then
if line.match('^\s*#') then
next
end
- var, val = line.split('=', 2)
+ var, val = line.chomp.split('=', 2)
# allow environment settings to override config files.
if var and val
ENV[var] ||= val
@@ -62,15 +62,7 @@ when 'pipeline'
abort
when 'tag'
ARGV.shift
- @sub = ARGV.shift
- if ['add', 'remove'].index @sub then
- exec `which arv-tag`.strip, *ARGV
- else
- $stderr.puts "Usage: \n" +
- "#{$0} tag add tag1 [tag2 ...] --objects object_uuid1 [object_uuid2...]\n" +
- "#{$0} tag remove tag1 [tag2 ...] --objects object_uuid1 [object_uuid2...]\n" +
- "#{$0} tag remove --all\n"
- end
+ exec `which arv-tag`.strip, *ARGV
end
ENV['ARVADOS_API_VERSION'] ||= 'v1'
diff --git a/sdk/cli/bin/arv-tag b/sdk/cli/bin/arv-tag
index 5860c2e..9b3339b 100755
--- a/sdk/cli/bin/arv-tag
+++ b/sdk/cli/bin/arv-tag
@@ -5,18 +5,25 @@
# arv tag remove tag1 [tag2 ...] --object obj_uuid1 [--object obj_uuid2 ...]
# arv tag remove tag1 [tag2 ...] --all
+def usage
+ abort "Usage:\n" +
+ "arv tag add tag1 [tag2 ...] --objects object_uuid1 [object_uuid2...]\n" +
+ "arv tag remove tag1 [tag2 ...] --objects object_uuid1 [object_uuid2...]\n" +
+ "arv tag remove --all\n"
+end
+
def tag_add(tag, obj_uuid)
request_body = {}
request_body[:api_token] = ENV['ARVADOS_API_TOKEN']
- return client.execute(:api_method => 'arvados.links.create',
- :parameters => {
- :name => tag
- :link_class => :tag,
- :head_uuid => obj_uuid,
- },
- :body => request_body,
- :authenticated => false)
+ return $client.execute(:api_method => $arvados.links.create,
+ :parameters => {
+ :name => tag,
+ :link_class => :tag,
+ :head_uuid => obj_uuid,
+ },
+ :body => request_body,
+ :authenticated => false)
end
def tag_remove(tag, obj_uuid=nil)
@@ -28,16 +35,16 @@ def tag_remove(tag, obj_uuid=nil)
params[:head_uuid] = obj_uuid
end
- return client.execute(:api_method => 'arvados.links.destroy',
- :parameters => params,
- :body => request_body,
- :authenticated => false)
+ return $client.execute(:api_method => $arvados.links.destroy,
+ :parameters => params,
+ :body => request_body,
+ :authenticated => false)
end
if RUBY_VERSION < '1.9.3' then
abort <<-EOS
#{$0.gsub(/^\.\//,'')} requires Ruby version 1.9.3 or higher.
- EOS
+EOS
end
$arvados_api_version = ENV['ARVADOS_API_VERSION'] || 'v1'
@@ -45,6 +52,7 @@ $arvados_api_host = ENV['ARVADOS_API_HOST'] or
abort "#{$0}: fatal: ARVADOS_API_HOST environment variable not set."
$arvados_api_token = ENV['ARVADOS_API_TOKEN'] or
abort "#{$0}: fatal: ARVADOS_API_TOKEN environment variable not set."
+$arvados_api_host_insecure = ENV['ARVADOS_API_HOST_INSECURE'] == 'yes'
begin
require 'rubygems'
@@ -73,7 +81,7 @@ module Kernel
end
end
-if $arvados_api_host.match /local/
+if $arvados_api_host_insecure or $arvados_api_host.match /local/
# You probably don't care about SSL certificate checks if you're
# testing with a dev server.
suppress_warnings { OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE }
@@ -110,7 +118,7 @@ $options = Trollop::with_standard_exception_handling p do
end
if $options[:all] and ARGV[0] != 'remove'
- abort "#{$0}: the --all option is only valid with the tag 'remove' command"
+ usage
end
# Set up the API client.
@@ -141,7 +149,7 @@ when 'remove'
end
end
else
- abort "unknown tag command #{cmd}"
+ usage
end
if global_opts[:human] or global_opts[:pretty] then
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list