bump proptest to 0.8 and uuid to 0.7

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-12-13 13:23:50 +01:00
parent 774f2f04f1
commit 8750bcf58d
3 changed files with 544 additions and 4 deletions

View File

@ -0,0 +1,183 @@
From edc933562e1baa58ef445a81d8e4e9341adae7e9 Mon Sep 17 00:00:00 2001
From: Andy Grover <agrover@redhat.com>
Date: Wed, 12 Dec 2018 10:47:48 -0800
Subject: [PATCH 1/2] Update proptest to 0.8.x
Brings in rand 0.5.x.
Signed-off-by: Andy Grover <agrover@redhat.com>
---
Cargo.lock | 62 +++++++++++++++++++++++++++++++++++++++++-------------
Cargo.toml | 2 +-
2 files changed, 48 insertions(+), 16 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 730b7bf..d94de22 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -64,7 +64,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "byteorder"
-version = "1.2.1"
+version = "1.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -72,7 +72,7 @@ name = "bytes"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -110,6 +110,14 @@ dependencies = [
"vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
+[[package]]
+name = "cloudabi"
+version = "0.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "crc"
version = "1.4.0"
@@ -282,7 +290,7 @@ dependencies = [
name = "libstratis"
version = "1.0.2"
dependencies = [
- "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
"crc 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -299,7 +307,7 @@ dependencies = [
"loopdev 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "proptest 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proptest 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -429,16 +437,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "proptest"
-version = "0.7.2"
+version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bit-set 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rusty-fork 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -463,6 +472,31 @@ dependencies = [
"winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
+[[package]]
+name = "rand"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
[[package]]
name = "redox_syscall"
version = "0.1.18"
@@ -488,11 +522,6 @@ dependencies = [
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "regex-syntax"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "regex-syntax"
version = "0.6.1"
@@ -790,12 +819,13 @@ dependencies = [
"checksum bit-set 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6f1efcc46c18245a69c38fcc5cc650f16d3a59d034f3106e9ed63748f695730a"
"checksum bit-vec 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4440d5cb623bb7390ae27fec0bb6c61111969860f8e3ae198bfa0663645e67cf"
"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf"
-"checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23"
+"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d"
"checksum bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1b7db437d718977f6dc9b2e3fd6fc343c02ac6b899b73fdd2179163447bd9ce9"
"checksum cc 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a9b13a57efd6b30ecd6598ebdb302cca617930b5470647570468a65d12ef9719"
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
"checksum chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e48d85528df61dc964aa43c5f6ca681a19cfa74939b2348d204bd08a981f2fb0"
"checksum clap 2.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = "110d43e343eb29f4f51c1db31beb879d546db27998577e5715270a54bcf41d3f"
+"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
"checksum crc 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc1914fae6f18ae347320f0ba5e4fc270e17c037ea621fe41ec7e8adf67d11b0"
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850"
"checksum dbus 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5b2c58aab20dd6637871e6e03cb6122f00b496a91eb65b688639c940012d8710"
@@ -833,14 +863,16 @@ dependencies = [
"checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99"
"checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe"
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903"
-"checksum proptest 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "27f275a76b824714046ce0b1e00323e06437e027f2d31b2b6272cae30afaf18d"
+"checksum proptest 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "926d0604475349f463fe44130aae73f2294b5309ab2ca0310b998bd334ef191f"
"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
+"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
+"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372"
+"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
"checksum redox_syscall 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "3041aeb6000db123d2c9c751433f526e1f404b23213bd733167ab770c3989b4d"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13c93d55961981ba9226a213b385216f83ab43bd6ac53ab16b2eeb47e337cf4e"
-"checksum regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e931c58b93d86f080c734bfd2bce7dd0079ae2331235818133c8be7f422e20e"
"checksum regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05b06a75f5217880fc5e905952a42750bf44787e56a6c6d6852ed0992f5e1d54"
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
"checksum rustc-demangle 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "aee45432acc62f7b9a108cc054142dac51f979e69e71ddce7d6fc7adf29e817e"
diff --git a/Cargo.toml b/Cargo.toml
index 83dac4b..aead8f3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -33,7 +33,7 @@ features = ["serde", "v4"]
[dev-dependencies]
loopdev = "0.2"
either = "1.1.0"
-proptest = "0.7.2"
+proptest = "0.8.0"
matches = "0.1.8"
[features]
--
2.20.0

View File

@ -0,0 +1,354 @@
From 90f6e358bcf266673aba10b781c728f1be68dd75 Mon Sep 17 00:00:00 2001
From: Andy Grover <agrover@redhat.com>
Date: Wed, 12 Dec 2018 10:50:57 -0800
Subject: [PATCH 2/2] Update uuid to 0.7.x
Some straightforward code changes were needed.
Signed-off-by: Andy Grover <agrover@redhat.com>
---
Cargo.lock | 21 +++++++++----------
Cargo.toml | 2 +-
src/dbus_api/pool.rs | 6 ++++--
src/dbus_api/util.rs | 2 +-
.../strat_engine/backstore/blockdevmgr.rs | 4 ++--
src/engine/strat_engine/backstore/metadata.rs | 8 +++----
src/engine/strat_engine/backstore/setup.rs | 6 +++---
src/engine/strat_engine/names.rs | 10 ++++-----
src/engine/strat_engine/thinpool/mdv.rs | 6 +++---
src/engine/strat_engine/thinpool/thinpool.rs | 2 +-
src/engine/structures.rs | 5 ++---
src/stratis/errors.rs | 6 +++---
12 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index d94de22..bb83a3d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -155,7 +155,7 @@ dependencies = [
"macro-attr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"newtype_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -309,12 +309,12 @@ dependencies = [
"nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"proptest 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"timerfd 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "uuid 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -577,7 +577,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde"
-version = "1.0.44"
+version = "1.0.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -607,7 +607,7 @@ dependencies = [
"dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -729,12 +729,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "uuid"
-version = "0.6.3"
+version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -880,7 +879,7 @@ dependencies = [
"checksum rusty-fork 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9591f190d2852720b679c21f66ad929f9f1d7bb09d1193c26167586029d8489c"
"checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c"
"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
-"checksum serde 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)" = "ce67a48047802238bfc88687272de48fd6d7af256b0097f110e968b0017235a5"
+"checksum serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)" = "6fa52f19aee12441d5ad11c9a00459122bd8f98707cadf9778c540674f1935b6"
"checksum serde_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "10552fad5500771f3902d0c5ba187c5881942b811b7ba0d8fbbfbf84d80806d3"
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a"
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b"
@@ -899,7 +898,7 @@ dependencies = [
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
-"checksum uuid 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8630752f979f1b6b87c49830a5e3784082545de63920d59fbaac252474319447"
+"checksum uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dab5c5526c5caa3d106653401a267fed923e7046f35895ffcb5ca42db64942e6"
"checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum wait-timeout 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b9f3bf741a801531993db6478b95682117471f76916f5e690dd8d45395b09349"
diff --git a/Cargo.toml b/Cargo.toml
index aead8f3..d10be5c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,7 +27,7 @@ timerfd = "1.0.0"
walkdir = "2.2.5"
[dependencies.uuid]
-version = "0.6"
+version = "0.7"
features = ["serde", "v4"]
[dev-dependencies]
diff --git a/src/dbus_api/pool.rs b/src/dbus_api/pool.rs
index 46395a3..d253861 100644
--- a/src/dbus_api/pool.rs
+++ b/src/dbus_api/pool.rs
@@ -131,8 +131,10 @@ fn destroy_filesystems(m: &MethodInfo<MTFn<TData>, TData>) -> MethodResult {
dbus_context.actions.borrow_mut().push_remove(op, m.tree);
}
- let return_value: Vec<String> =
- uuids.iter().map(|n| format!("{}", n.simple())).collect();
+ let return_value: Vec<String> = uuids
+ .iter()
+ .map(|n| n.to_simple_ref().to_string())
+ .collect();
return_message.append3(return_value, msg_code_ok(), msg_string_ok())
}
Err(err) => {
diff --git a/src/dbus_api/util.rs b/src/dbus_api/util.rs
index 87b6e08..170e892 100644
--- a/src/dbus_api/util.rs
+++ b/src/dbus_api/util.rs
@@ -87,7 +87,7 @@ pub fn get_uuid(i: &mut IterAppend, p: &PropInfo<MTFn<TData>, TData>) -> Result<
.as_ref()
.ok_or_else(|| MethodErr::failed(&format!("no data for object path {}", object_path)))?;
- i.append(format!("{}", data.uuid.simple()));
+ i.append(data.uuid.to_simple_ref().to_string());
Ok(())
}
diff --git a/src/engine/strat_engine/backstore/blockdevmgr.rs b/src/engine/strat_engine/backstore/blockdevmgr.rs
index 8b8ffda..518128b 100644
--- a/src/engine/strat_engine/backstore/blockdevmgr.rs
+++ b/src/engine/strat_engine/backstore/blockdevmgr.rs
@@ -74,7 +74,7 @@ impl BlkDevSegment {
impl fmt::Debug for BlkDevSegment {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("BlkDevSegment")
- .field("uuid", &self.uuid.simple().to_string())
+ .field("uuid", &self.uuid.to_simple_ref())
.field("segment", &self.segment)
.finish()
}
@@ -247,7 +247,7 @@ impl BlockDevMgr {
ErrorEnum::Error,
format!(
"Blockdev corresponding to UUID: {} not found.",
- uuid.simple().to_string()
+ uuid.to_simple_ref()
),
));
}
diff --git a/src/engine/strat_engine/backstore/metadata.rs b/src/engine/strat_engine/backstore/metadata.rs
index 1c36e3e..1c52dfc 100644
--- a/src/engine/strat_engine/backstore/metadata.rs
+++ b/src/engine/strat_engine/backstore/metadata.rs
@@ -358,8 +358,8 @@ impl StaticHeader {
buf[4..20].clone_from_slice(STRAT_MAGIC);
LittleEndian::write_u64(&mut buf[20..28], *self.blkdev_size);
buf[28] = STRAT_SIGBLOCK_VERSION;
- buf[32..64].clone_from_slice(self.pool_uuid.simple().to_string().as_bytes());
- buf[64..96].clone_from_slice(self.dev_uuid.simple().to_string().as_bytes());
+ buf[32..64].clone_from_slice(self.pool_uuid.to_simple_ref().to_string().as_bytes());
+ buf[64..96].clone_from_slice(self.dev_uuid.to_simple_ref().to_string().as_bytes());
LittleEndian::write_u64(&mut buf[96..104], *self.mda_size);
LittleEndian::write_u64(&mut buf[104..112], *self.reserved_size);
LittleEndian::write_u64(&mut buf[120..128], self.initialization_time);
@@ -419,8 +419,8 @@ impl fmt::Debug for StaticHeader {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("StaticHeader")
.field("blkdev_size", &self.blkdev_size)
- .field("pool_uuid", &self.pool_uuid.simple().to_string())
- .field("dev_uuid", &self.dev_uuid.simple().to_string())
+ .field("pool_uuid", &self.pool_uuid.to_simple_ref())
+ .field("dev_uuid", &self.dev_uuid.to_simple_ref())
.field("mda_size", &self.mda_size)
.field("reserved_size", &self.reserved_size)
.field("flags", &self.flags)
diff --git a/src/engine/strat_engine/backstore/setup.rs b/src/engine/strat_engine/backstore/setup.rs
index 9bd388c..23b89bf 100644
--- a/src/engine/strat_engine/backstore/setup.rs
+++ b/src/engine/strat_engine/backstore/setup.rs
@@ -283,7 +283,7 @@ pub fn get_blockdevs(
if !duplicate_uuids.is_empty() {
let err_msg = format!(
"The following list of Stratis UUIDs were each claimed by more than one Stratis device: {}",
- duplicate_uuids.iter().map(|p| p.simple().to_string()).collect::<Vec<String>>().join(", ")
+ duplicate_uuids.iter().map(|u| u.to_simple_ref().to_string()).collect::<Vec<_>>().join(", ")
);
return Err(StratisError::Engine(ErrorEnum::Invalid, err_msg));
}
@@ -292,8 +292,8 @@ pub fn get_blockdevs(
if uuids != recorded_uuids {
let err_msg = format!(
"UUIDs of devices found ({}) did not correspond with UUIDs specified in the metadata for this group of devices ({})",
- uuids.iter().map(|p| p.simple().to_string()).collect::<Vec<String>>().join(", "),
- recorded_uuids.iter().map(|p| p.simple().to_string()).collect::<Vec<String>>().join(", "),
+ uuids.iter().map(|u| u.to_simple_ref().to_string()).collect::<Vec<_>>().join(", "),
+ recorded_uuids.iter().map(|u| u.to_simple_ref().to_string()).collect::<Vec<_>>().join(", "),
);
return Err(StratisError::Engine(ErrorEnum::Invalid, err_msg));
}
diff --git a/src/engine/strat_engine/names.rs b/src/engine/strat_engine/names.rs
index 39c882f..0d5a0f1 100644
--- a/src/engine/strat_engine/names.rs
+++ b/src/engine/strat_engine/names.rs
@@ -43,7 +43,7 @@ pub enum ThinRole {
impl Display for ThinRole {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
- ThinRole::Filesystem(uuid) => write!(f, "fs-{}", uuid.simple().to_string()),
+ ThinRole::Filesystem(uuid) => write!(f, "fs-{}", uuid.to_simple_ref()),
}
}
}
@@ -104,7 +104,7 @@ pub fn format_flex_ids(pool_uuid: PoolUuid, role: FlexRole) -> (DmNameBuf, DmUui
let value = format!(
"stratis-{}-private-{}-flex-{}",
FORMAT_VERSION,
- pool_uuid.simple().to_string(),
+ pool_uuid.to_simple_ref(),
role
);
(
@@ -128,7 +128,7 @@ pub fn format_thin_ids(pool_uuid: PoolUuid, role: ThinRole) -> (DmNameBuf, DmUui
let value = format!(
"stratis-{}-{}-thin-{}",
FORMAT_VERSION,
- pool_uuid.simple().to_string(),
+ pool_uuid.to_simple_ref(),
role
);
(
@@ -153,7 +153,7 @@ pub fn format_thinpool_ids(pool_uuid: PoolUuid, role: ThinPoolRole) -> (DmNameBu
let value = format!(
"stratis-{}-private-{}-thinpool-{}",
FORMAT_VERSION,
- pool_uuid.simple().to_string(),
+ pool_uuid.to_simple_ref(),
role
);
(
@@ -178,7 +178,7 @@ pub fn format_backstore_ids(pool_uuid: PoolUuid, role: CacheRole) -> (DmNameBuf,
let value = format!(
"stratis-{}-private-{}-physical-{}",
FORMAT_VERSION,
- pool_uuid.simple().to_string(),
+ pool_uuid.to_simple_ref(),
role
);
(
diff --git a/src/engine/strat_engine/thinpool/mdv.rs b/src/engine/strat_engine/thinpool/mdv.rs
index d80e7ab..86669a4 100644
--- a/src/engine/strat_engine/thinpool/mdv.rs
+++ b/src/engine/strat_engine/thinpool/mdv.rs
@@ -96,7 +96,7 @@ impl MetadataVol {
/// Set up an existing Metadata Volume.
pub fn setup(pool_uuid: PoolUuid, dev: LinearDev) -> StratisResult<MetadataVol> {
- let filename = format!(".mdv-{}", pool_uuid.simple());
+ let filename = format!(".mdv-{}", pool_uuid.to_simple_ref());
let mount_pt: PathBuf = vec![DEV_PATH, &filename].iter().collect();
let mdv = MetadataVol { dev, mount_pt };
@@ -131,7 +131,7 @@ impl MetadataVol {
let data = serde_json::to_string(&fs.record(name, uuid))?;
let path = self.mount_pt
.join(FILESYSTEM_DIR)
- .join(uuid.simple().to_string())
+ .join(uuid.to_simple_ref().to_string())
.with_extension("json");
let temp_path = path.clone().with_extension("temp");
@@ -159,7 +159,7 @@ impl MetadataVol {
pub fn rm_fs(&self, fs_uuid: FilesystemUuid) -> StratisResult<()> {
let fs_path = self.mount_pt
.join(FILESYSTEM_DIR)
- .join(fs_uuid.simple().to_string())
+ .join(fs_uuid.to_simple_ref().to_string())
.with_extension("json");
let _mount = MountedMDV::mount(self)?;
diff --git a/src/engine/strat_engine/thinpool/thinpool.rs b/src/engine/strat_engine/thinpool/thinpool.rs
index e0495eb..4c6baa8 100644
--- a/src/engine/strat_engine/thinpool/thinpool.rs
+++ b/src/engine/strat_engine/thinpool/thinpool.rs
@@ -751,7 +751,7 @@ impl ThinPool {
) -> StratisResult<Sectors> {
assert!(modulus != Sectors(0));
let sub_device_str = if data { "data" } else { "metadata" };
- let pool_uuid_str = pool_uuid.simple().to_string();
+ let pool_uuid_str = pool_uuid.to_simple_ref();
info!(
"Attempting to extend thinpool {} sub-device belonging to pool {} by {}",
sub_device_str, pool_uuid_str, extend_size,
diff --git a/src/engine/structures.rs b/src/engine/structures.rs
index ed68e30..337b93d 100644
--- a/src/engine/structures.rs
+++ b/src/engine/structures.rs
@@ -20,9 +20,8 @@ impl<T: fmt::Debug> fmt::Debug for Table<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_map()
.entries(
- self.iter().map(|(name, uuid, item)| {
- ((name.to_string(), uuid.simple().to_string()), item)
- }),
+ self.iter()
+ .map(|(name, uuid, item)| ((name.to_string(), uuid.to_simple_ref()), item)),
)
.finish()
}
diff --git a/src/stratis/errors.rs b/src/stratis/errors.rs
index e4e9c2e..ed8f502 100644
--- a/src/stratis/errors.rs
+++ b/src/stratis/errors.rs
@@ -33,7 +33,7 @@ pub enum StratisError {
Engine(ErrorEnum, String),
Io(io::Error),
Nix(nix::Error),
- Uuid(uuid::ParseError),
+ Uuid(uuid::parser::ParseError),
Utf8(str::Utf8Error),
Serde(serde_json::error::Error),
DM(devicemapper::DmError),
@@ -111,8 +111,8 @@ impl From<nix::Error> for StratisError {
}
}
-impl From<uuid::ParseError> for StratisError {
- fn from(err: uuid::ParseError) -> StratisError {
+impl From<uuid::parser::ParseError> for StratisError {
+ fn from(err: uuid::parser::ParseError) -> StratisError {
StratisError::Uuid(err)
}
}
--
2.20.0

View File

@ -13,6 +13,9 @@ Summary: Daemon that manages block devices to create filesystems
License: MPLv2.0
URL: https://github.com/stratis-storage/stratisd
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# https://github.com/stratis-storage/stratisd/pull/1372
Patch0001: 0001-Update-proptest-to-0.8.x.patch
Patch0002: 0002-Update-uuid-to-0.7.x.patch
ExclusiveArch: %{rust_arches}
@ -37,15 +40,15 @@ BuildRequires: (crate(serde_derive/default) >= 1.0.0 with crate(serde_derive/de
BuildRequires: (crate(serde_json/default) >= 1.0.0 with crate(serde_json/default) < 2.0.0)
BuildRequires: (crate(tempfile/default) >= 3.0.1 with crate(tempfile/default) < 4.0.0)
BuildRequires: (crate(timerfd/default) >= 1.0.0 with crate(timerfd/default) < 2.0.0)
BuildRequires: (crate(uuid/default) >= 0.6.0 with crate(uuid/default) < 0.7.0)
BuildRequires: (crate(uuid/serde) >= 0.6.0 with crate(uuid/serde) < 0.7.0)
BuildRequires: (crate(uuid/v4) >= 0.6.0 with crate(uuid/v4) < 0.7.0)
BuildRequires: (crate(uuid/default) >= 0.7.0 with crate(uuid/default) < 0.8.0)
BuildRequires: (crate(uuid/serde) >= 0.7.0 with crate(uuid/serde) < 0.8.0)
BuildRequires: (crate(uuid/v4) >= 0.7.0 with crate(uuid/v4) < 0.8.0)
BuildRequires: (crate(walkdir/default) >= 2.2.5 with crate(walkdir/default) < 3.0.0)
%if %{with check}
BuildRequires: (crate(either/default) >= 1.1.0 with crate(either/default) < 2.0.0)
BuildRequires: (crate(loopdev/default) >= 0.2.0 with crate(loopdev/default) < 0.3.0)
BuildRequires: (crate(matches/default) >= 0.1.8 with crate(matches/default) < 0.2.0)
BuildRequires: (crate(proptest/default) >= 0.7.2 with crate(proptest/default) < 0.8.0)
BuildRequires: (crate(proptest/default) >= 0.8.0 with crate(proptest/default) < 0.9.0)
%endif
BuildRequires: %{_bindir}/a2x
BuildRequires: systemd