uricp 0.0.23 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/uricp/strategy/common.rb +5 -0
- data/lib/uricp/strategy/piped_cache.rb +1 -2
- data/lib/uricp/strategy/piped_rbd_get.rb +0 -1
- data/lib/uricp/strategy/rbd_cache_base_snap.rb +0 -1
- data/lib/uricp/strategy/rbd_cache_check.rb +0 -1
- data/lib/uricp/strategy/rbd_cache_clone.rb +0 -1
- data/lib/uricp/strategy/rbd_cache_upload.rb +1 -2
- data/lib/uricp/strategy/rbd_cached_get.rb +0 -1
- data/lib/uricp/strategy/rbd_put.rb +7 -5
- data/lib/uricp/strategy/rbd_snap.rb +0 -1
- data/lib/uricp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff143aca9aad2f48ac2948322959e24a421b95cd04cb545a8921f18e601139f0
|
4
|
+
data.tar.gz: 719d814583ab1513f10bbc04f6c8487c0fb803a6ab8fb4a307de6c1bf6d7c39a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78a4cab2edab9ef6ca65a483dc5fe5cad0b221bfd170f891812af0c5883ae11e9b64e60b49be535fc41829d91f21820016c5fcfb94850c83487b0dcb4ba9c36b
|
7
|
+
data.tar.gz: 740916783658e36e3346eda72ea799a7a35e58da3cbb40619516c2f788de343c72a976c95229d85beccd5e9a3b5afcc1ebc85b726ed5cc6e85c2a9723877efaf
|
data/Gemfile.lock
CHANGED
@@ -2,6 +2,7 @@ module Uricp::Strategy
|
|
2
2
|
module Common
|
3
3
|
include Methadone::CLILogging
|
4
4
|
include Uricp::CurlPrimitives
|
5
|
+
include Methadone::SH
|
5
6
|
|
6
7
|
def initialize(options)
|
7
8
|
@options = options
|
@@ -158,6 +159,10 @@ module Uricp::Strategy
|
|
158
159
|
uri.scheme == 'rbd' && uri.path.include?('@')
|
159
160
|
end
|
160
161
|
|
162
|
+
def rbd_cache_upload_available?
|
163
|
+
rbd_cache_name && !rbd_cache_image_exists?(rbd_cache_name)
|
164
|
+
end
|
165
|
+
|
161
166
|
def rbd_cache_image_exists?(target)
|
162
167
|
command = "rbd status --id #{rbd_id} --format json #{target} 2>/dev/null"
|
163
168
|
if dry_run?
|
@@ -4,7 +4,6 @@ module Uricp::Strategy
|
|
4
4
|
class PipedCache
|
5
5
|
include Uricp::Strategy::Common
|
6
6
|
include Uricp::Strategy::CacheCommon
|
7
|
-
include Methadone::SH
|
8
7
|
|
9
8
|
def appropriate?
|
10
9
|
with_active_cache do
|
@@ -26,7 +25,7 @@ module Uricp::Strategy
|
|
26
25
|
@proposed_options = options.dup
|
27
26
|
@proposed_options['sweep'] = [temp_cache_file, cache_file]
|
28
27
|
image_spec_to_check = rbd_cache_image_spec(to)
|
29
|
-
if to.scheme == 'rbd'
|
28
|
+
if to.scheme == 'rbd'
|
30
29
|
@proposed_options['rbd_cache_name'] = image_spec_to_check
|
31
30
|
end
|
32
31
|
@proposed_options.delete('cache')
|
@@ -1,14 +1,13 @@
|
|
1
1
|
module Uricp::Strategy
|
2
2
|
class RbdCacheUpload
|
3
3
|
include Uricp::Strategy::Common
|
4
|
-
include Methadone::SH
|
5
4
|
|
6
5
|
def appropriate?
|
7
6
|
if compression_required? || conversion_required?
|
8
7
|
debug "#{self.class.name}: not ready to upload"
|
9
8
|
return false
|
10
9
|
end
|
11
|
-
if
|
10
|
+
if rbd_cache_upload_available?
|
12
11
|
case from.scheme
|
13
12
|
when 'pipe', 'file'
|
14
13
|
return proposal if to.scheme == 'rbd'
|
@@ -7,11 +7,13 @@ module Uricp::Strategy
|
|
7
7
|
debug "#{self.class.name}: not ready to upload"
|
8
8
|
return false
|
9
9
|
end
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
if rbd_cache_upload_available?
|
11
|
+
debug "#{self.class.name}: cacheing in RBD instead"
|
12
|
+
return false
|
13
|
+
end
|
14
|
+
case from.scheme
|
15
|
+
when 'pipe', 'file'
|
16
|
+
return proposal if to.scheme == 'rbd'
|
15
17
|
end
|
16
18
|
debug "#{self.class.name}: not appropriate"
|
17
19
|
false
|
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.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neil Wilson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|