8784: Fix test for latest firefox.
[arvados.git] / services / api / script / salvage_collection.rb
1 #!/usr/bin/env ruby
2
3 # Take two input parameters: a collection uuid and reason
4 # Get "src_collection" with the given uuid
5 # Create a new collection with:
6 #   src_collection.manifest_text as "invalid_manifest_text.txt"
7 #   Locators from src_collection.manifest_text as "salvaged_data"
8 # Update src_collection:
9 #   Set src_collection.manifest_text to: ""
10 #   Append to src_collection.name: " (reason; salvaged data at new_collection.uuid)"
11 #   Set portable_data_hash to "d41d8cd98f00b204e9800998ecf8427e+0"
12
13 require 'trollop'
14 require './lib/salvage_collection'
15 include SalvageCollection
16
17 opts = Trollop::options do
18   banner ''
19   banner "Usage: salvage_collection.rb " +
20     "{uuid} {reason}"
21   banner ''
22   opt :uuid, "uuid of the collection to be salvaged.", type: :string, required: true
23   opt :reason, "Reason for salvaging.", type: :string, required: false
24 end
25
26 # Salvage the collection with the given uuid
27 SalvageCollection.salvage_collection opts.uuid, opts.reason