uricp 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/features/auth_download.feature +8 -0
- data/lib/uricp/strategy/piped_remote_get.rb +9 -0
- data/lib/uricp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad39a6e06ce8e9371def28e21ec16e128fd41b89
|
|
4
|
+
data.tar.gz: f9403707e1ffe3fa81efa9f18df76007d5c270c8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8955d60c70f1092bc8f8cc2fb768c3e80b0450024de3d34141a665efd0989afc6c47de1d8a82d261a1d30751f9ced86213b6bb59e86684e0d838444e6b463942
|
|
7
|
+
data.tar.gz: c4314e1e064c2a4d2db7ebe78c5eaa0626824e4edb10fa623f926eefff9a914c56d1c2ea9646649a217589e039adfe2d8ef72a2f3392e55f750c062201ba4f05
|
data/Gemfile.lock
CHANGED
|
@@ -37,6 +37,14 @@ Feature: Authenticated download of images from orbit
|
|
|
37
37
|
And a 0 byte file named "/tmp/uricp/cache/img-zeroy" should exist
|
|
38
38
|
And the file named "/tmp/uricp/cache/img-zeroy" should have a file format of "raw"
|
|
39
39
|
|
|
40
|
+
Scenario: zero download to raw, cache, size limited
|
|
41
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
|
42
|
+
When I retrieve "img-zeroy" with options "--cache=/tmp/uricp --target-format=raw --max-cache=8MB" from container "test" into "file:////tmp/uricp/srv-testx"
|
|
43
|
+
Then a file named "/tmp/uricp/srv-testx" should exist
|
|
44
|
+
And the file named "/tmp/uricp/srv-testx" should have a file format of "raw"
|
|
45
|
+
And a 0 byte file named "/tmp/uricp/cache/img-zeroy" should exist
|
|
46
|
+
And the file named "/tmp/uricp/cache/img-zeroy" should have a file format of "raw"
|
|
47
|
+
|
|
40
48
|
Scenario: qcow download convert to raw, cache
|
|
41
49
|
Given a correctly initialised cache at "/tmp/uricp"
|
|
42
50
|
When I retrieve "img-qcow2" with options "--target-format=raw --cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-test4"
|
|
@@ -52,10 +52,19 @@ module Uricp::Strategy
|
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def size_peek
|
|
55
|
+
size_headers=headers
|
|
56
|
+
size_headers['Range'] = 'bytes=0-0'
|
|
55
57
|
options['from_uri'].open(headers) do |u|
|
|
56
58
|
match = %r<bytes\s+(\d+)-(\d+)/(\d+|\*)>i.match(u.meta['content-range'])
|
|
57
59
|
match && match[3].to_i
|
|
58
60
|
end
|
|
61
|
+
rescue OpenURI::HTTPError => e
|
|
62
|
+
case e.io.status[0]
|
|
63
|
+
when '416'
|
|
64
|
+
0
|
|
65
|
+
else
|
|
66
|
+
raise
|
|
67
|
+
end
|
|
59
68
|
rescue SocketError => e
|
|
60
69
|
raise SocketError, options['from_uri'].to_s+" inaccessible: "+e.message
|
|
61
70
|
end
|
data/lib/uricp/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: uricp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Neil Wilson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-10-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|