fix: fix error message when different pool found
currently when the name of the pool on the disk, and the name of
pool we are trying to import mismatches, the error message contains
wrong pool name. This change fixes the pool name in case of an errored
pool import
@@ -279,10 +279,11 @@ impl Lvs {
if name != lvs.name() {
warn!("no pool with name {} found on this device -- unloading the pool", name);
+ let pool_name = lvs.name().to_string();
lvs.export().await.unwrap();
Err(Error::Import {
source: Errno::EINVAL,
- name: name.into(),
+ name: pool_name,
})
} else {
lvs.share_all().await;
