[ARVADOS] updated: b1f65fcd4fa5fca5400f63fa25823fef6229a158

git at public.curoverse.com git at public.curoverse.com
Tue Nov 18 14:20:59 EST 2014


Summary of changes:
 sdk/python/setup.py                                |  4 +-
 .../api/app/controllers/application_controller.rb  | 70 +++++++++---------
 .../arvados/v1/collections_controller.rb           | 23 +-----
 services/api/app/models/collection.rb              | 85 ++++++++++++++++++----
 .../arvados/v1/collections_controller_test.rb      | 72 +++++++++---------
 services/api/test/integration/websocket_test.rb    |  2 +-
 services/fuse/setup.py                             |  3 +-
 7 files changed, 151 insertions(+), 108 deletions(-)

       via  b1f65fcd4fa5fca5400f63fa25823fef6229a158 (commit)
       via  22c135139279edcf5be0218eb90c375f2433a4b9 (commit)
       via  b75e2a12f618e2b69f3af1672abfb4773e202bed (commit)
       via  84d5db363e4c10881fdb5317b01f46bdc33c002a (commit)
       via  dea90c956d96d06e39df0f6567c3bb6582a5b3dd (commit)
       via  75a07d8175c9ee9a1c212cd1abe1c0d64a91cfc7 (commit)
      from  3735d52b65928e3626a8e223acadc318a3d31097 (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 b1f65fcd4fa5fca5400f63fa25823fef6229a158
Merge: 3735d52 22c1351
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Nov 18 14:16:09 2014 -0500

    Merge branch '4552-collection-unique-name' closes #4552
    
    Conflicts:
    	services/api/app/models/collection.rb

diff --cc services/api/app/models/collection.rb
index d2d674e,08c50d9..66d7add
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@@ -96,39 -114,17 +115,39 @@@ class Collection < ArvadosMode
    end
  
    def ensure_hash_matches_manifest_text
-     if manifest_text_changed? or portable_data_hash_changed?
-       computed_hash = "#{Digest::MD5.hexdigest(manifest_text)}+#{manifest_text.bytesize}"
-       unless computed_hash == portable_data_hash
-         logger.debug "(computed) '#{computed_hash}' != '#{portable_data_hash}' (provided)"
-         errors.add(:portable_data_hash, "does not match hash of manifest_text")
-         return false
-       end
+     return true unless manifest_text_changed? or portable_data_hash_changed?
+     # No need verify it if :set_portable_data_hash just computed it!
+     return true if not @need_pdh_validation
+     expect_pdh = compute_pdh
+     if expect_pdh != portable_data_hash
+       errors.add(:portable_data_hash,
+                  "does not match computed hash #{expect_pdh}")
+       return false
      end
-     true
    end
  
 +  def check_encoding
 +    if manifest_text.encoding.name == 'UTF-8' and manifest_text.valid_encoding?
 +      true
 +    else
 +      begin
 +        # If Ruby thinks the encoding is something else, like 7-bit
 +        # ASCII, but its stored bytes are equal to the (valid) UTF-8
 +        # encoding of the same string, we declare it to be a UTF-8
 +        # string.
 +        utf8 = manifest_text
 +        utf8.force_encoding Encoding::UTF_8
 +        if utf8.valid_encoding? and utf8 == manifest_text.encode(Encoding::UTF_8)
 +          manifest_text = utf8
 +          return true
 +        end
 +      rescue
 +      end
 +      errors.add :manifest_text, "must use UTF-8 encoding"
 +      false
 +    end
 +  end
 +
    def redundancy_status
      if redundancy_confirmed_as.nil?
        'unconfirmed'

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list