tape: improve code reuse
This commit is contained in:
parent
ddebbb52fd
commit
b81e37f6ab
@ -467,16 +467,11 @@ impl MediaPool {
|
|||||||
match media.status() {
|
match media.status() {
|
||||||
MediaStatus::Full => { /* OK */ },
|
MediaStatus::Full => { /* OK */ },
|
||||||
MediaStatus::Writable if (seq + 1) == media_count => {
|
MediaStatus::Writable if (seq + 1) == media_count => {
|
||||||
match media.location() {
|
let media_location = media.location();
|
||||||
MediaLocation::Online(_) => {
|
if self.location_is_available(media_location) {
|
||||||
last_is_writable = true;
|
last_is_writable = true;
|
||||||
},
|
} else {
|
||||||
MediaLocation::Offline => {
|
if let MediaLocation::Vault(vault) = media_location {
|
||||||
if self.use_offline_media {
|
|
||||||
last_is_writable = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MediaLocation::Vault(vault) => {
|
|
||||||
bail!("writable media offsite in vault '{}'", vault);
|
bail!("writable media offsite in vault '{}'", vault);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user