| 1 | # | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # Copyright (c) 2002 Paul Winkeler. All Rights Reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 3 | # This program is free software; you may redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||
| 4 | # the same terms as Perl itself. | ||||||||||||||||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||||||||||||||||
| 6 | package NBU::Media; | ||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use Date::Parse; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use NBU::Robot; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | use Exporter (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | use AutoLoader qw(AUTOLOAD); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use vars qw(%densities %mediaTypes); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | $VERSION = do { my @r=(q$Revision: 1.45 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r }; | |||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | @ISA = qw(); | |||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | @EXPORT = qw(%densities); | |||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | @EXPORT_OK = qw(); | |||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | %EXPORT_TAGS = qw(); | |||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | %densities = ( | |||||||||||||||||||||||||||||||||||||||||
| 28 | 13 => "dlt", | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 16 => "8mm", | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 12 => "4mm", | ||||||||||||||||||||||||||||||||||||||||||
| 31 | 6 => "hcart", | ||||||||||||||||||||||||||||||||||||||||||
| 32 | 19 => "dtf", | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 9 => "odiskwm", | ||||||||||||||||||||||||||||||||||||||||||
| 34 | 10 => "odiskwo", | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 => "qscsi", | ||||||||||||||||||||||||||||||||||||||||||
| 36 | 15 => "dlt2", | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 14 => "hcart2", | ||||||||||||||||||||||||||||||||||||||||||
| 38 | 20 => "hcart3", | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 21 => "dlt3", | ||||||||||||||||||||||||||||||||||||||||||
| 40 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | my %mediaCodes = ( | |||||||||||||||||||||||||||||||||||||||||
| 43 | 'DLT' => 11, | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 'DLT_CLN'=> 12, | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 'DLT2' => 16, | ||||||||||||||||||||||||||||||||||||||||||
| 46 | 'DLT2_CLN' => 17, | ||||||||||||||||||||||||||||||||||||||||||
| 47 | 'DLT3' => 26, | ||||||||||||||||||||||||||||||||||||||||||
| 48 | 'DLT3_CLN' => 27, | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 'HCART' => 6, | ||||||||||||||||||||||||||||||||||||||||||
| 50 | 'HC_CLN' => 13, | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 'HCART2' => 14, | ||||||||||||||||||||||||||||||||||||||||||
| 52 | 'HC2_CLN' => 15, | ||||||||||||||||||||||||||||||||||||||||||
| 53 | 'HCART3' => 24, | ||||||||||||||||||||||||||||||||||||||||||
| 54 | 'HC3_CLN' => 25, | ||||||||||||||||||||||||||||||||||||||||||
| 55 | '4MM' => 9, | ||||||||||||||||||||||||||||||||||||||||||
| 56 | '4MM_CLN' => 10, | ||||||||||||||||||||||||||||||||||||||||||
| 57 | '8MM' => 4, | ||||||||||||||||||||||||||||||||||||||||||
| 58 | '8MM_CLN' => 5, | ||||||||||||||||||||||||||||||||||||||||||
| 59 | # '8MM2' => | ||||||||||||||||||||||||||||||||||||||||||
| 60 | # '8MM2_CLN' => | ||||||||||||||||||||||||||||||||||||||||||
| 61 | # 'D2' => | ||||||||||||||||||||||||||||||||||||||||||
| 62 | # 'D2_CLN' => | ||||||||||||||||||||||||||||||||||||||||||
| 63 | 'DTF' => 22, | ||||||||||||||||||||||||||||||||||||||||||
| 64 | 'DTF_CLN' => 23, | ||||||||||||||||||||||||||||||||||||||||||
| 65 | 'DEFAULT' => 0, | ||||||||||||||||||||||||||||||||||||||||||
| 66 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 1 | %mediaTypes = ( | |||||||||||||||||||||||||||||||||||||||||
| 69 | 0 => "DEFAULT", | ||||||||||||||||||||||||||||||||||||||||||
| 70 | 11 => "DLT cartridge tape", | ||||||||||||||||||||||||||||||||||||||||||
| 71 | 12 => "DLT cleaning tape", | ||||||||||||||||||||||||||||||||||||||||||
| 72 | 16 => "DLT cartridge tape 2", | ||||||||||||||||||||||||||||||||||||||||||
| 73 | 17 => "DLT cleaning tape 2", | ||||||||||||||||||||||||||||||||||||||||||
| 74 | 26 => "DLT cartridge tape 3", | ||||||||||||||||||||||||||||||||||||||||||
| 75 | 27 => "DLT cleaning tape 3", | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 6 => "1/2\" cartridge tape", | ||||||||||||||||||||||||||||||||||||||||||
| 77 | 13 => "1/2\" cleaning tape", | ||||||||||||||||||||||||||||||||||||||||||
| 78 | 14 => "1/2\" cartridge tape 2", | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 15 => "1/2\" cleaning tape 2", | ||||||||||||||||||||||||||||||||||||||||||
| 80 | 24 => "1/2\" cartridge tape 3", | ||||||||||||||||||||||||||||||||||||||||||
| 81 | 25 => "1/2\" cleaning tape 3", | ||||||||||||||||||||||||||||||||||||||||||
| 82 | 4 => "8MM cartridge tape", | ||||||||||||||||||||||||||||||||||||||||||
| 83 | 5 => "8MM cleaning tape", | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 9 => "4MM cartridge tape", | ||||||||||||||||||||||||||||||||||||||||||
| 85 | 10 => "4MM cleaning tape", | ||||||||||||||||||||||||||||||||||||||||||
| 86 | 22 => "DTF cartridge tape", | ||||||||||||||||||||||||||||||||||||||||||
| 87 | 23 => "DTF cleaning tape", | ||||||||||||||||||||||||||||||||||||||||||
| 88 | 1 => "Rewritable optical disk", | ||||||||||||||||||||||||||||||||||||||||||
| 89 | 2 => "WORM optical disk", | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 8 => "QIC - 1/4\" cartridge tape", | ||||||||||||||||||||||||||||||||||||||||||
| 91 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | 1 | my %mediaList; | |||||||||||||||||||||||||||||||||||||||||
| 94 | my %barcodeList; | ||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | my $proto = shift; | |||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | my $media = {}; | |||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | bless $media, $proto; | |||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | my $mediaID = shift; | |||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | my $voldbHost = shift; | |||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | if (exists($mediaList{$mediaID})) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | $media = $mediaList{$mediaID}; | |||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||
| 109 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | $media->{VOLDBHOST} = $voldbHost; | |||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | $media->{RVSN} = $mediaID; | |||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | $mediaList{$media->{RVSN}} = $media; | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | my $removable = shift; | |||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | $media->{REMOVABLE} = $removable; | |||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||
| 118 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | $media->{REMOVABLE} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | return $media; | |||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||
| 125 | 1 | my $filled; | |||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | sub populate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
populate: not called CC=37 SCAR=72.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | my $proto = shift; | |||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | my $volume; | |||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | my $updateRobot = shift; | |||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | my $pipe; | |||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | $filled = 0; | |||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | # | ||||||||||||||||||||||||||||||||||||||||||
| 136 | # Have to force the pool information to load or we dead-lock. It appears | ||||||||||||||||||||||||||||||||||||||||||
| 137 | # the VM database deamon is single threaded and won't answer a pool query | ||||||||||||||||||||||||||||||||||||||||||
| 138 | # until the volume listing is completed... | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | NBU::Pool->populate; | |||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | # | ||||||||||||||||||||||||||||||||||||||||||
| 142 | # The rule is to populate with information from all the volume databases | ||||||||||||||||||||||||||||||||||||||||||
| 143 | # maintained by the master and its active media servers (allowing for the | ||||||||||||||||||||||||||||||||||||||||||
| 144 | # master in fact not to be a media server). | ||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | my %voldbHosts; | |||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | my @masters = NBU->masters; my $master = $masters[0]; | |||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | $voldbHosts{$master->name} = $master; | |||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | foreach my $ms (NBU::StorageUnit->mediaServers($master)) { | |||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | if (defined(my $EMMserver = $ms->EMMserver)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | $voldbHosts{$EMMserver->name} = $EMMserver; | |||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||
| 152 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | $voldbHosts{$ms->name} = $ms; | |||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | foreach my $voldbHost (values %voldbHosts) { | |||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | $pipe = NBU->cmd("vmquery -a -w -h ".$voldbHost->name." |"); | |||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | $_ = <$pipe>; $_ = <$pipe>; $_ = <$pipe>; | |||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | while (<$pipe>) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | my ($id, | |||||||||||||||||||||||||||||||||||||||||
| 162 | $opticalPartner, | ||||||||||||||||||||||||||||||||||||||||||
| 163 | $mediaCode, | ||||||||||||||||||||||||||||||||||||||||||
| 164 | $barcode, $barcodePartner, | ||||||||||||||||||||||||||||||||||||||||||
| 165 | $robotHostName, $robotType, $robotNumber, $slotNumber, | ||||||||||||||||||||||||||||||||||||||||||
| 166 | $side, | ||||||||||||||||||||||||||||||||||||||||||
| 167 | $volumeGroup, | ||||||||||||||||||||||||||||||||||||||||||
| 168 | $volumePool, $volumePoolNumber, $previousVolumePool, | ||||||||||||||||||||||||||||||||||||||||||
| 169 | $mountCount, $maxMounts, $cleaningCount, | ||||||||||||||||||||||||||||||||||||||||||
| 170 | $creationDate, $creationTime, | ||||||||||||||||||||||||||||||||||||||||||
| 171 | $assignDate, $assignTime, | ||||||||||||||||||||||||||||||||||||||||||
| 172 | $firstMountDate, $firstMountTime, | ||||||||||||||||||||||||||||||||||||||||||
| 173 | $lastMountDate, $lastMountTime, | ||||||||||||||||||||||||||||||||||||||||||
| 174 | $expirationDate, $expirationTime, | ||||||||||||||||||||||||||||||||||||||||||
| 175 | $status, | ||||||||||||||||||||||||||||||||||||||||||
| 176 | $offsiteLocation, | ||||||||||||||||||||||||||||||||||||||||||
| 177 | $offsiteSentDate, $offsiteSentTime, | ||||||||||||||||||||||||||||||||||||||||||
| 178 | $offsiteReturnDate, $offsiteReturnTime, | ||||||||||||||||||||||||||||||||||||||||||
| 179 | $offsiteSlot, | ||||||||||||||||||||||||||||||||||||||||||
| 180 | $offsiteSessionID, | ||||||||||||||||||||||||||||||||||||||||||
| 181 | $version, | ||||||||||||||||||||||||||||||||||||||||||
| 182 | $description, | ||||||||||||||||||||||||||||||||||||||||||
| 183 | ) | ||||||||||||||||||||||||||||||||||||||||||
| 184 | = split(/[\s]+/, $_, 37); | ||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||
| 186 | # | ||||||||||||||||||||||||||||||||||||||||||
| 187 | # "Normal" installations will not use the same serial number in more than | ||||||||||||||||||||||||||||||||||||||||||
| 188 | # one volume database. Thus our test here more or less expects not to | ||||||||||||||||||||||||||||||||||||||||||
| 189 | # find this id: | ||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | $volume = NBU::Media->byID($id, $voldbHost); | |||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | if (defined($volume)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | ▶ | if (NBU->debug) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | print STDERR "Volume $id in voldb on ".$voldbHost->name." conflicts with existing volume\n"; | |||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | print STDERR " Host: ".$volume->voldbHost."\n"; | |||||||||||||||||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||||||
| 198 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | $volume = NBU::Media->new($id, $voldbHost); | |||||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | $filled += 1; | |||||||||||||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | $volume->barcode($barcode); | |||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | if (!exists($mediaCodes{$mediaCode})) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | $volume->{MEDIATYPE} = $mediaCodes{$mediaCode}; | |||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | $volume->{CLEANINGCOUNT} = $cleaningCount; | |||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | $volume->{MOUNTCOUNT} = $mountCount; | |||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | $volume->{MAXMOUNTS} = $maxMounts; | |||||||||||||||||||||||||||||||||||||||||
| 213 | $volume->{GROUP} = ($volumeGroup eq "---") ? undef : $volumeGroup, | ||||||||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | $volume->{POOL} = NBU::Pool->byID($volumePoolNumber); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | $volume->{PREVIOUSPOOL} = NBU::Pool->byName($previousVolumePool); | |||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | ▶ | $volume->{OFFSITELOCATION} = $offsiteLocation unless ($offsiteLocation eq "-"); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | $volume->{OFFSITESLOT} = $offsiteSlot unless (($offsiteSlot eq "-") || ($offsiteSlot == 0)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$offsiteSlot eq "-" or $offsiteSlot == 0
MC/DC0%0/2
$offsiteSlot eq "-" or $offsiteSlot == 0
$offsiteSlot eq "-"
$offsiteSlot == 0
Truth table0%0/3
A or B
A= $offsiteSlot eq "-"B= $offsiteSlot == 0
| |||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | $volume->{OFFSITESESSIONID} = $offsiteSessionID unless (($offsiteSessionID eq "-") || ($offsiteSessionID == 0)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$offsiteSessionID eq "-" or $offsiteSessionID == 0
MC/DC0%0/2
$offsiteSessionID eq "-" or $offsiteSessionID == 0
$offsiteSessionID eq "-"
$offsiteSessionID == 0
Truth table0%0/3
A or B
A= $offsiteSessionID eq "-"B= $offsiteSessionID == 0
| |||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | my $rd = $offsiteReturnDate." ".$offsiteReturnTime; $rd = str2time($rd); | |||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | ▶ | $volume->{OFFSITERETURN} = $rd if (defined($rd)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||
| 226 | 0 | $volume->{VERSION} = $version; | |||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | $volume->{DESCRIPTION} = $description; | |||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | if ($updateRobot && ($robotType ne "NONE")) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$updateRobot and $robotType ne "NONE"
MC/DC0%0/2
$updateRobot and $robotType ne "NONE"
$updateRobot
$robotType ne "NONE"
Truth table0%0/3
A and B
A= $updateRobotB= $robotType ne "NONE"
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | my $robot; | |||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | ▶ | if (!defined($robot = NBU::Robot->byID($robotNumber))) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | $robot = NBU::Robot->new($robotNumber, $robotType); | |||||||||||||||||||||||||||||||||||||||||
| 233 | } | ||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | $robot->insert($slotNumber, $volume); | |||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | $volume->robot($robot); | |||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | $volume->slot($slotNumber); | |||||||||||||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | $volume->{NETBACKUP} = ($status == 1); | |||||||||||||||||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | close($pipe); | |||||||||||||||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | $pipe = NBU->cmd("bpmedialist -L |"); | |||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | my $mmdbHost; | |||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | ▶ | while (<$pipe>) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | if (/^Server Host = ([\S]+)[\s]*$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | $mmdbHost = NBU::Host->new($1); | |||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | ▶ | if (/^media_id = ([A-Z0-9]+), partner_id.*/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | ▶ | if ($volume) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | print STDERR "New media $1 encountered when old one ".$volume->id." still active!\n"; | |||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | exit 0; | |||||||||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | $volume = NBU::Media->byID($1); | |||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | ▶ | if (!defined($volume)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | ▶ | print STDERR "Media id $1 in mmdb on ".$mmdbHost->name." was not found in any voldb!\n" if (NBU->debug); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | $volume = NBU::Media->new($1); | |||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | $filled += 1; | |||||||||||||||||||||||||||||||||||||||||
| 263 | } | ||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | $volume->{MMLOADED} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | $volume->{MMDBHOST} = $mmdbHost; | |||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | $filled += 1; | |||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | ▶ | if (/^density = ([\S]+) \(([\d]+)\)/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | $volume->{DENSITY} = $2; | |||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | ▶ | if (/^allocated = .* \(([0-9]+)\)/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | $volume->{ALLOCATED} = $1; | |||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | ▶ | if (/^last_written = .* \(([0-9]+)\)/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | $volume->{LASTWRITTEN} = $1; | |||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | ▶ | if (/^expiration = .* \(([0-9]+)\)/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | $volume->{LASTIMAGEEXPIRES} = $1; | |||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | ▶ | if (/^last_read = .* \(([0-9]+)\)/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | $volume->{LASTREAD} = $1; | |||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 290 | } | ||||||||||||||||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | ▶ | if (/retention_level = ([\d]+), num_restores = ([\d]+)/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | $volume->retention(NBU::Retention->byLevel($1)); | |||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | $volume->{RESTORECOUNT} = $2; | |||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 296 | } | ||||||||||||||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | if (/^kbytes = ([\d]+), nimages = ([\d]+), vimages = ([\d]+)/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | $volume->{SIZE} = $1; | |||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | $volume->{IMAGECOUNT} = $2; | |||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | $volume->{VIMAGECOUNT} = $3; | |||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | ▶ | if (/^status = 0x([0-9A-Fa-f]+)/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | my $status = $1; | |||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | my $result = 0; | |||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | foreach my $d (split(/ */, $status)) { | |||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | ▶ | $d =~ tr/a-z/A-Z/; $d = (ord($d) - ord('A') + 10) if ($d =~ /[A-F]/); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | $result *= 16; | |||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | $result += $d; | |||||||||||||||||||||||||||||||||||||||||
| 312 | } | ||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | $volume->{STATUS} = $result; | |||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | ▶ | if (/^res1 = /) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 319 | } | ||||||||||||||||||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | ▶ | if (/^vmpool = /) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | ▶ | if (/^[\s]*$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 326 | 0 | $volume = undef; | |||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | print STDERR "Unknown line\n \"$_\"\n"; | |||||||||||||||||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | close($pipe); | |||||||||||||||||||||||||||||||||||||||||
| 332 | } | ||||||||||||||||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||||||||||||||||
| 334 | 1 | my $mediaErrors = "/usr/local/etc/media-errors.csv"; | |||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | ▶ | sub loadErrors { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
loadErrors: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 336 | 0 | my $proto = shift; | |||||||||||||||||||||||||||||||||||||||||
| 337 | 0 | my $errorCount; | |||||||||||||||||||||||||||||||||||||||||
| 338 | |||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | ▶ | if (open(PIPE, "<$mediaErrors")) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 340 | # Place this use directive inside an eval to postpone missing | ||||||||||||||||||||||||||||||||||||||||||
| 341 | # module diagnostics until run-time | ||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | eval "use Text::CSV_XS"; | |||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | my $csv = Text::CSV_XS->new(); | |||||||||||||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||||||||||||
| 345 | # Throw the header line away and read the remaining error lines | ||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | $_ = <PIPE>; | |||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | ▶ | while (<PIPE>) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | ▶ | if ($csv->parse($_)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 349 | 0 | my @fields = $csv->fields; | |||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | my $volume = NBU::Media->byID($fields[1]); | |||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | ▶ | if ($volume) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 352 | 0 | $volume->logError($fields[0], $fields[5]); | |||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | $errorCount += 1; | |||||||||||||||||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||||||||||||||||
| 355 | } | ||||||||||||||||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||||||||||||||||
| 357 | 0 | close(PIPE); | |||||||||||||||||||||||||||||||||||||||||
| 358 | } | ||||||||||||||||||||||||||||||||||||||||||
| 359 | elsif (NBU->debug) { | ||||||||||||||||||||||||||||||||||||||||||
| 360 | 0 | print STDERR "Could not load media errors from $mediaErrors\n"; | |||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||
| 362 | 0 | return $errorCount; | |||||||||||||||||||||||||||||||||||||||||
| 363 | } | ||||||||||||||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | ▶ | sub listIDs { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
listIDs: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 366 | 0 | my $proto = shift; | |||||||||||||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | return (keys %mediaList); | |||||||||||||||||||||||||||||||||||||||||
| 369 | } | ||||||||||||||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||||||||||||||
| 371 | 0 | ▶ | sub listVolumes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
listVolumes: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 372 | 0 | my $proto = shift; | |||||||||||||||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||||||||||||||||
| 374 | 0 | return (values %mediaList); | |||||||||||||||||||||||||||||||||||||||||
| 375 | } | ||||||||||||||||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||||||||||||||
| 377 | 0 | ▶ | sub list { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
list: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 378 | 0 | my $proto = shift; | |||||||||||||||||||||||||||||||||||||||||
| 379 | |||||||||||||||||||||||||||||||||||||||||||
| 380 | 0 | return ($proto->listVolumes); | |||||||||||||||||||||||||||||||||||||||||
| 381 | } | ||||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||
| 383 | 0 | ▶ | sub voldbHost { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
voldbHost: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 384 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||||||||||
| 386 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 387 | 0 | $self->{VOLDBHOST} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 388 | } | ||||||||||||||||||||||||||||||||||||||||||
| 389 | 0 | return $self->{VOLDBHOST}; | |||||||||||||||||||||||||||||||||||||||||
| 390 | } | ||||||||||||||||||||||||||||||||||||||||||
| 391 | |||||||||||||||||||||||||||||||||||||||||||
| 392 | 0 | ▶ | sub mmdbHost { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mmdbHost: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 393 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 394 | |||||||||||||||||||||||||||||||||||||||||||
| 395 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 396 | 0 | $self->{MMDBHOST} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 397 | } | ||||||||||||||||||||||||||||||||||||||||||
| 398 | 0 | return $self->{MMDBHOST}; | |||||||||||||||||||||||||||||||||||||||||
| 399 | } | ||||||||||||||||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||||||||||||||||
| 401 | 0 | ▶ | sub density { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
density: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 402 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||||||||||||||||
| 404 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 405 | 0 | my $density = shift; | |||||||||||||||||||||||||||||||||||||||||
| 406 | 0 | $self->{DENSITY} = $density; | |||||||||||||||||||||||||||||||||||||||||
| 407 | } | ||||||||||||||||||||||||||||||||||||||||||
| 408 | |||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | ▶ | return $self->removable ? $densities{$self->{DENSITY}} : "disk"; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 410 | } | ||||||||||||||||||||||||||||||||||||||||||
| 411 | |||||||||||||||||||||||||||||||||||||||||||
| 412 | 0 | ▶ | sub retention { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
retention: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 413 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 414 | |||||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 416 | 0 | my $retention = shift; | |||||||||||||||||||||||||||||||||||||||||
| 417 | 0 | $self->{RETENTION} = $retention; | |||||||||||||||||||||||||||||||||||||||||
| 418 | } | ||||||||||||||||||||||||||||||||||||||||||
| 419 | |||||||||||||||||||||||||||||||||||||||||||
| 420 | 0 | return $self->{RETENTION}; | |||||||||||||||||||||||||||||||||||||||||
| 421 | } | ||||||||||||||||||||||||||||||||||||||||||
| 422 | |||||||||||||||||||||||||||||||||||||||||||
| 423 | 0 | ▶ | sub barcode { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
barcode: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 424 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 425 | |||||||||||||||||||||||||||||||||||||||||||
| 426 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | ▶ | if (my $oldBarcode = $self->{EVSN}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | delete $barcodeList{$oldBarcode}; | |||||||||||||||||||||||||||||||||||||||||
| 429 | 0 | $self->{EVSN} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 430 | } | ||||||||||||||||||||||||||||||||||||||||||
| 431 | 0 | ▶ | if (my $barcode = shift) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 432 | 0 | $barcodeList{$barcode} = $self; | |||||||||||||||||||||||||||||||||||||||||
| 433 | 0 | $self->{EVSN} = $barcode; | |||||||||||||||||||||||||||||||||||||||||
| 434 | } | ||||||||||||||||||||||||||||||||||||||||||
| 435 | } | ||||||||||||||||||||||||||||||||||||||||||
| 436 | 0 | return $self->{EVSN}; | |||||||||||||||||||||||||||||||||||||||||
| 437 | } | ||||||||||||||||||||||||||||||||||||||||||
| 438 | |||||||||||||||||||||||||||||||||||||||||||
| 439 | 0 | ▶ | sub previousPool { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
previousPool: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 440 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||||||||||||||||
| 442 | 0 | return $self->{PREVIOUSPOOL}; | |||||||||||||||||||||||||||||||||||||||||
| 443 | } | ||||||||||||||||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||||||||||||||||
| 445 | 0 | ▶ | sub pool { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pool: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 446 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||||||||||||||||
| 448 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 449 | 0 | my $newPool = shift; | |||||||||||||||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||||||||||||||||
| 451 | 0 | ▶ | if ((my $oldPool = $self->{POOL}) != $newPool) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 452 | 0 | my @masters = NBU->masters; my $master = $masters[0]; | |||||||||||||||||||||||||||||||||||||||||
| 453 | 0 | NBU->cmd("vmchange". | |||||||||||||||||||||||||||||||||||||||||
| 454 | " -h ".$master->name. | ||||||||||||||||||||||||||||||||||||||||||
| 455 | " -m ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 456 | " -p ".$newPool->id); | ||||||||||||||||||||||||||||||||||||||||||
| 457 | 0 | $self->{PREVIOUSPOOL} = $oldPool; | |||||||||||||||||||||||||||||||||||||||||
| 458 | 0 | $self->{POOL} = $newPool; | |||||||||||||||||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||||||||||||||||
| 460 | } | ||||||||||||||||||||||||||||||||||||||||||
| 461 | 0 | return $self->{POOL}; | |||||||||||||||||||||||||||||||||||||||||
| 462 | } | ||||||||||||||||||||||||||||||||||||||||||
| 463 | |||||||||||||||||||||||||||||||||||||||||||
| 464 | 0 | ▶ | sub group { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
group: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 465 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 466 | |||||||||||||||||||||||||||||||||||||||||||
| 467 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | my $group = shift; | |||||||||||||||||||||||||||||||||||||||||
| 469 | 0 | my $update; | |||||||||||||||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||||||||||||||||
| 471 | 0 | ▶ | if (defined($group)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 472 | 0 | ▶ | $update = !defined($self->{GROUP}) || ($group ne $self->{GROUP}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
!defined($self->{'GROUP'}) || $group ne $self->{'GROUP'}
MC/DC0%0/2
!defined($self->{'GROUP'}) || $group ne $self->{'GROUP'}
!defined($self->{'GROUP'})
$group ne $self->{'GROUP'}
Truth table0%0/3
not(A) || B
A= !defined($self->{'GROUP'})B= $group ne $self->{'GROUP'}
| |||||||||||||||||||||||||||||||||||||||||||
| 473 | } | ||||||||||||||||||||||||||||||||||||||||||
| 474 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 475 | 0 | $update = defined($self->{GROUP}); | |||||||||||||||||||||||||||||||||||||||||
| 476 | } | ||||||||||||||||||||||||||||||||||||||||||
| 477 | 0 | ▶ | if ($update) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 478 | 0 | my @masters = NBU->masters; my $master = $masters[0]; | |||||||||||||||||||||||||||||||||||||||||
| 479 | 0 | ▶ | NBU->cmd("vmchange". | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 480 | " -h ".$master->name. | ||||||||||||||||||||||||||||||||||||||||||
| 481 | " -m ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 482 | " -new_v ".(defined($group) ? $group : "---"), 0); | ||||||||||||||||||||||||||||||||||||||||||
| 483 | 0 | $self->{GROUP} = $group; | |||||||||||||||||||||||||||||||||||||||||
| 484 | } | ||||||||||||||||||||||||||||||||||||||||||
| 485 | } | ||||||||||||||||||||||||||||||||||||||||||
| 486 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 487 | 0 | ▶ | $self->populate if (!defined($filled)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 488 | } | ||||||||||||||||||||||||||||||||||||||||||
| 489 | 0 | return $self->{GROUP}; | |||||||||||||||||||||||||||||||||||||||||
| 490 | } | ||||||||||||||||||||||||||||||||||||||||||
| 491 | |||||||||||||||||||||||||||||||||||||||||||
| 492 | 0 | ▶ | sub type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
type: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 493 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 494 | |||||||||||||||||||||||||||||||||||||||||||
| 495 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 496 | 0 | $self->{MEDIATYPE} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 497 | } | ||||||||||||||||||||||||||||||||||||||||||
| 498 | |||||||||||||||||||||||||||||||||||||||||||
| 499 | 0 | return $self->{MEDIATYPE}; | |||||||||||||||||||||||||||||||||||||||||
| 500 | } | ||||||||||||||||||||||||||||||||||||||||||
| 501 | |||||||||||||||||||||||||||||||||||||||||||
| 502 | 0 | ▶ | sub logError { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
logError: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 503 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 504 | 0 | my ($eDate, $eType) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 505 | 0 | $eDate = str2time($eDate); | |||||||||||||||||||||||||||||||||||||||||
| 506 | |||||||||||||||||||||||||||||||||||||||||||
| 507 | 0 | ▶ | if (!defined($self->{ERRORHIST})) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 508 | 0 | $self->{ERRORHIST} = {}; | |||||||||||||||||||||||||||||||||||||||||
| 509 | } | ||||||||||||||||||||||||||||||||||||||||||
| 510 | 0 | my $ehR = $self->{ERRORHIST}; | |||||||||||||||||||||||||||||||||||||||||
| 511 | 0 | $$ehR{$eDate} = $eType; | |||||||||||||||||||||||||||||||||||||||||
| 512 | |||||||||||||||||||||||||||||||||||||||||||
| 513 | 0 | $self->{LASTERRORDATE} = $eDate; | |||||||||||||||||||||||||||||||||||||||||
| 514 | 0 | $self->{LASTERRORTYPE} = $eType; | |||||||||||||||||||||||||||||||||||||||||
| 515 | |||||||||||||||||||||||||||||||||||||||||||
| 516 | 0 | return $self->{ERRORCOUNT} += 1; | |||||||||||||||||||||||||||||||||||||||||
| 517 | } | ||||||||||||||||||||||||||||||||||||||||||
| 518 | |||||||||||||||||||||||||||||||||||||||||||
| 519 | 0 | ▶ | sub lastError { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
lastError: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 520 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 521 | |||||||||||||||||||||||||||||||||||||||||||
| 522 | 0 | ▶ | if ($self->{ERRORCOUNT} > 0) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 523 | 0 | return ($self->{LASTERRORDATE}, $self->{LASTERRORTYPE}); | |||||||||||||||||||||||||||||||||||||||||
| 524 | } | ||||||||||||||||||||||||||||||||||||||||||
| 525 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 526 | 0 | return (0, undef); | |||||||||||||||||||||||||||||||||||||||||
| 527 | } | ||||||||||||||||||||||||||||||||||||||||||
| 528 | } | ||||||||||||||||||||||||||||||||||||||||||
| 529 | |||||||||||||||||||||||||||||||||||||||||||
| 530 | 0 | ▶ | sub errorList { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
errorList: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 531 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 532 | 0 | ▶ | if (!defined($self->{ERRORHIST})) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 533 | 0 | $self->{ERRORHIST} = {}; | |||||||||||||||||||||||||||||||||||||||||
| 534 | } | ||||||||||||||||||||||||||||||||||||||||||
| 535 | 0 | my $ehR = $self->{ERRORHIST}; | |||||||||||||||||||||||||||||||||||||||||
| 536 | 0 | return %$ehR; | |||||||||||||||||||||||||||||||||||||||||
| 537 | } | ||||||||||||||||||||||||||||||||||||||||||
| 538 | |||||||||||||||||||||||||||||||||||||||||||
| 539 | 0 | ▶ | sub errorCount { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
errorCount: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 540 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 541 | |||||||||||||||||||||||||||||||||||||||||||
| 542 | 0 | return $self->{ERRORCOUNT}; | |||||||||||||||||||||||||||||||||||||||||
| 543 | } | ||||||||||||||||||||||||||||||||||||||||||
| 544 | |||||||||||||||||||||||||||||||||||||||||||
| 545 | 1 | my %cleaningTypes = ( | |||||||||||||||||||||||||||||||||||||||||
| 546 | 12 => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 547 | 17 => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 548 | 27 => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 549 | 13 => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 550 | 15 => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 551 | 25 => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 552 | 5 => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 553 | 9 => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 554 | 23 => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 555 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 556 | 0 | ▶ | sub cleaningTape { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cleaningTape: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 557 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 558 | |||||||||||||||||||||||||||||||||||||||||||
| 559 | 0 | return exists($cleaningTypes{$self->type}); | |||||||||||||||||||||||||||||||||||||||||
| 560 | } | ||||||||||||||||||||||||||||||||||||||||||
| 561 | |||||||||||||||||||||||||||||||||||||||||||
| 562 | 0 | ▶ | sub cleaningCount { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cleaningCount: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 563 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 564 | |||||||||||||||||||||||||||||||||||||||||||
| 565 | 0 | ▶ | if (@_ && $self->cleaningTape) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ and $self->cleaningTape
MC/DC0%0/2
@_ and $self->cleaningTape
@_
$self->cleaningTape
Truth table0%0/3
A and B
A= @_B= $self->cleaningTape
| |||||||||||||||||||||||||||||||||||||||||||
| 566 | 0 | my $newCount = shift; | |||||||||||||||||||||||||||||||||||||||||
| 567 | 0 | NBU->cmd("vmchange -m ".$self->id." -n $newCount", 0); | |||||||||||||||||||||||||||||||||||||||||
| 568 | 0 | $self->{CLEANINGCOUNT} = $newCount; | |||||||||||||||||||||||||||||||||||||||||
| 569 | } | ||||||||||||||||||||||||||||||||||||||||||
| 570 | 0 | return $self->{CLEANINGCOUNT}; | |||||||||||||||||||||||||||||||||||||||||
| 571 | } | ||||||||||||||||||||||||||||||||||||||||||
| 572 | |||||||||||||||||||||||||||||||||||||||||||
| 573 | 0 | ▶ | sub mountCount { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mountCount: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 574 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 575 | |||||||||||||||||||||||||||||||||||||||||||
| 576 | 0 | ▶ | if ($self->cleaningTape) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 577 | 0 | return $self->{CLEANINGCOUNT}; | |||||||||||||||||||||||||||||||||||||||||
| 578 | } | ||||||||||||||||||||||||||||||||||||||||||
| 579 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 580 | 0 | return $self->{MOUNTCOUNT}; | |||||||||||||||||||||||||||||||||||||||||
| 581 | } | ||||||||||||||||||||||||||||||||||||||||||
| 582 | } | ||||||||||||||||||||||||||||||||||||||||||
| 583 | |||||||||||||||||||||||||||||||||||||||||||
| 584 | 0 | ▶ | sub firstMounted { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
firstMounted: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 585 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 586 | |||||||||||||||||||||||||||||||||||||||||||
| 587 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 588 | 0 | ▶ | if (@_ > 1) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 589 | # convert date and time to epoch seconds first | ||||||||||||||||||||||||||||||||||||||||||
| 590 | } | ||||||||||||||||||||||||||||||||||||||||||
| 591 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 592 | 0 | $self->{FIRSTMOUNTED} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 593 | } | ||||||||||||||||||||||||||||||||||||||||||
| 594 | } | ||||||||||||||||||||||||||||||||||||||||||
| 595 | |||||||||||||||||||||||||||||||||||||||||||
| 596 | 0 | return $self->{FIRSTMOUNTED}; | |||||||||||||||||||||||||||||||||||||||||
| 597 | } | ||||||||||||||||||||||||||||||||||||||||||
| 598 | |||||||||||||||||||||||||||||||||||||||||||
| 599 | 0 | ▶ | sub lastMounted { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
lastMounted: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 600 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 601 | |||||||||||||||||||||||||||||||||||||||||||
| 602 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 603 | 0 | ▶ | if (@_ > 1) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 604 | # convert date and time to epoch seconds first | ||||||||||||||||||||||||||||||||||||||||||
| 605 | } | ||||||||||||||||||||||||||||||||||||||||||
| 606 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 607 | 0 | $self->{LASTMOUNTED} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 608 | } | ||||||||||||||||||||||||||||||||||||||||||
| 609 | } | ||||||||||||||||||||||||||||||||||||||||||
| 610 | |||||||||||||||||||||||||||||||||||||||||||
| 611 | 0 | return $self->{LASTMOUNTED}; | |||||||||||||||||||||||||||||||||||||||||
| 612 | } | ||||||||||||||||||||||||||||||||||||||||||
| 613 | |||||||||||||||||||||||||||||||||||||||||||
| 614 | 0 | ▶ | sub byBarcode { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
byBarcode: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 615 | 0 | my $proto = shift; | |||||||||||||||||||||||||||||||||||||||||
| 616 | 0 | my $barcode = shift; | |||||||||||||||||||||||||||||||||||||||||
| 617 | |||||||||||||||||||||||||||||||||||||||||||
| 618 | |||||||||||||||||||||||||||||||||||||||||||
| 619 | 0 | ▶ | if (my $volume = $barcodeList{$barcode}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 620 | 0 | return $volume; | |||||||||||||||||||||||||||||||||||||||||
| 621 | } | ||||||||||||||||||||||||||||||||||||||||||
| 622 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 623 | } | ||||||||||||||||||||||||||||||||||||||||||
| 624 | |||||||||||||||||||||||||||||||||||||||||||
| 625 | # | ||||||||||||||||||||||||||||||||||||||||||
| 626 | # The Recorded Volume Serial Number (rvsn) is the same as the media ID hence | ||||||||||||||||||||||||||||||||||||||||||
| 627 | # the two variants of id and byID. | ||||||||||||||||||||||||||||||||||||||||||
| 628 | 0 | ▶ | sub byID { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
byID: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 629 | 0 | my $proto = shift; | |||||||||||||||||||||||||||||||||||||||||
| 630 | 0 | my $mediaID = shift; | |||||||||||||||||||||||||||||||||||||||||
| 631 | 0 | my $voldbHost = shift; | |||||||||||||||||||||||||||||||||||||||||
| 632 | |||||||||||||||||||||||||||||||||||||||||||
| 633 | |||||||||||||||||||||||||||||||||||||||||||
| 634 | 0 | ▶ | if (my $volume = $mediaList{$mediaID}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 635 | 0 | return $volume; | |||||||||||||||||||||||||||||||||||||||||
| 636 | } | ||||||||||||||||||||||||||||||||||||||||||
| 637 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 638 | } | ||||||||||||||||||||||||||||||||||||||||||
| 639 | |||||||||||||||||||||||||||||||||||||||||||
| 640 | 0 | ▶ | sub byRVSN { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
byRVSN: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 641 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 642 | |||||||||||||||||||||||||||||||||||||||||||
| 643 | 0 | return $self->byID(@_); | |||||||||||||||||||||||||||||||||||||||||
| 644 | } | ||||||||||||||||||||||||||||||||||||||||||
| 645 | |||||||||||||||||||||||||||||||||||||||||||
| 646 | 0 | ▶ | sub id { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
id: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 647 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 648 | |||||||||||||||||||||||||||||||||||||||||||
| 649 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 650 | 0 | $self->{RVSN} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 651 | 0 | $mediaList{$self->{RVSN}} = $self; | |||||||||||||||||||||||||||||||||||||||||
| 652 | } | ||||||||||||||||||||||||||||||||||||||||||
| 653 | |||||||||||||||||||||||||||||||||||||||||||
| 654 | 0 | return $self->{RVSN}; | |||||||||||||||||||||||||||||||||||||||||
| 655 | } | ||||||||||||||||||||||||||||||||||||||||||
| 656 | 0 | ▶ | sub rvsn { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
rvsn: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 657 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 658 | |||||||||||||||||||||||||||||||||||||||||||
| 659 | 0 | return $self->id(@_); | |||||||||||||||||||||||||||||||||||||||||
| 660 | } | ||||||||||||||||||||||||||||||||||||||||||
| 661 | |||||||||||||||||||||||||||||||||||||||||||
| 662 | # | ||||||||||||||||||||||||||||||||||||||||||
| 663 | # This is the External Volume Serial Number which can sometimes be | ||||||||||||||||||||||||||||||||||||||||||
| 664 | # different than the Recorded Volume Serial Number (RVSN). | ||||||||||||||||||||||||||||||||||||||||||
| 665 | 0 | ▶ | sub evsn { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
evsn: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 666 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 667 | |||||||||||||||||||||||||||||||||||||||||||
| 668 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 669 | 0 | $self->{EVSN} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 670 | } | ||||||||||||||||||||||||||||||||||||||||||
| 671 | |||||||||||||||||||||||||||||||||||||||||||
| 672 | 0 | return $self->{EVSN}; | |||||||||||||||||||||||||||||||||||||||||
| 673 | } | ||||||||||||||||||||||||||||||||||||||||||
| 674 | |||||||||||||||||||||||||||||||||||||||||||
| 675 | 0 | ▶ | sub robot { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
robot: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 676 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 677 | |||||||||||||||||||||||||||||||||||||||||||
| 678 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 679 | 0 | $self->{ROBOT} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 680 | } | ||||||||||||||||||||||||||||||||||||||||||
| 681 | |||||||||||||||||||||||||||||||||||||||||||
| 682 | 0 | return $self->{ROBOT}; | |||||||||||||||||||||||||||||||||||||||||
| 683 | } | ||||||||||||||||||||||||||||||||||||||||||
| 684 | |||||||||||||||||||||||||||||||||||||||||||
| 685 | 0 | ▶ | sub slot { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
slot: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 686 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 687 | |||||||||||||||||||||||||||||||||||||||||||
| 688 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 689 | 0 | $self->{SLOT} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 690 | } | ||||||||||||||||||||||||||||||||||||||||||
| 691 | |||||||||||||||||||||||||||||||||||||||||||
| 692 | 0 | return $self->{SLOT}; | |||||||||||||||||||||||||||||||||||||||||
| 693 | } | ||||||||||||||||||||||||||||||||||||||||||
| 694 | |||||||||||||||||||||||||||||||||||||||||||
| 695 | 0 | ▶ | sub selected { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
selected: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 696 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 697 | |||||||||||||||||||||||||||||||||||||||||||
| 698 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 699 | 0 | $self->{SELECTED} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 700 | } | ||||||||||||||||||||||||||||||||||||||||||
| 701 | 0 | return $self->{SELECTED}; | |||||||||||||||||||||||||||||||||||||||||
| 702 | } | ||||||||||||||||||||||||||||||||||||||||||
| 703 | |||||||||||||||||||||||||||||||||||||||||||
| 704 | 0 | ▶ | sub mount { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mount: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 705 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 706 | |||||||||||||||||||||||||||||||||||||||||||
| 707 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 708 | 0 | my ($mount, $drive) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 709 | 0 | $self->{MOUNT} = $mount; | |||||||||||||||||||||||||||||||||||||||||
| 710 | 0 | $self->{DRIVE} = $drive; | |||||||||||||||||||||||||||||||||||||||||
| 711 | } | ||||||||||||||||||||||||||||||||||||||||||
| 712 | 0 | return $self->{MOUNT}; | |||||||||||||||||||||||||||||||||||||||||
| 713 | } | ||||||||||||||||||||||||||||||||||||||||||
| 714 | |||||||||||||||||||||||||||||||||||||||||||
| 715 | 0 | ▶ | sub drive { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
drive: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 716 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 717 | |||||||||||||||||||||||||||||||||||||||||||
| 718 | 0 | return $self->{DRIVE}; | |||||||||||||||||||||||||||||||||||||||||
| 719 | } | ||||||||||||||||||||||||||||||||||||||||||
| 720 | |||||||||||||||||||||||||||||||||||||||||||
| 721 | 0 | ▶ | sub unmount { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unmount: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 722 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 723 | 0 | my ($tm) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 724 | |||||||||||||||||||||||||||||||||||||||||||
| 725 | 0 | ▶ | if (my $mount = $self->mount) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 726 | 0 | $mount->unmount($tm); | |||||||||||||||||||||||||||||||||||||||||
| 727 | } | ||||||||||||||||||||||||||||||||||||||||||
| 728 | |||||||||||||||||||||||||||||||||||||||||||
| 729 | 0 | $self->mount(undef, undef); | |||||||||||||||||||||||||||||||||||||||||
| 730 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 731 | } | ||||||||||||||||||||||||||||||||||||||||||
| 732 | |||||||||||||||||||||||||||||||||||||||||||
| 733 | 0 | ▶ | sub read { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 734 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 735 | |||||||||||||||||||||||||||||||||||||||||||
| 736 | 0 | my ($size, $speed) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 737 | |||||||||||||||||||||||||||||||||||||||||||
| 738 | 0 | $self->{SIZE} += $size; | |||||||||||||||||||||||||||||||||||||||||
| 739 | 0 | $self->{READTIME} += ($size / $speed); | |||||||||||||||||||||||||||||||||||||||||
| 740 | } | ||||||||||||||||||||||||||||||||||||||||||
| 741 | |||||||||||||||||||||||||||||||||||||||||||
| 742 | 0 | ▶ | sub write { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
write: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 743 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 744 | |||||||||||||||||||||||||||||||||||||||||||
| 745 | 0 | my ($size, $speed) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 746 | |||||||||||||||||||||||||||||||||||||||||||
| 747 | 0 | $self->{SIZE} += $size; | |||||||||||||||||||||||||||||||||||||||||
| 748 | 0 | $self->{WRITETIME} += ($size / $speed); | |||||||||||||||||||||||||||||||||||||||||
| 749 | } | ||||||||||||||||||||||||||||||||||||||||||
| 750 | |||||||||||||||||||||||||||||||||||||||||||
| 751 | 0 | ▶ | sub writeTime { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
writeTime: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 752 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 753 | |||||||||||||||||||||||||||||||||||||||||||
| 754 | 0 | return $self->{WRITETIME}; | |||||||||||||||||||||||||||||||||||||||||
| 755 | } | ||||||||||||||||||||||||||||||||||||||||||
| 756 | |||||||||||||||||||||||||||||||||||||||||||
| 757 | 0 | ▶ | sub dataWritten { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dataWritten: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 758 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 759 | |||||||||||||||||||||||||||||||||||||||||||
| 760 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 761 | 0 | $self->{SIZE} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 762 | } | ||||||||||||||||||||||||||||||||||||||||||
| 763 | 0 | return $self->{SIZE}; | |||||||||||||||||||||||||||||||||||||||||
| 764 | } | ||||||||||||||||||||||||||||||||||||||||||
| 765 | |||||||||||||||||||||||||||||||||||||||||||
| 766 | 0 | ▶ | sub allocated { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
allocated: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 767 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 768 | |||||||||||||||||||||||||||||||||||||||||||
| 769 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 770 | 0 | $self->{ALLOCATED} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 771 | } | ||||||||||||||||||||||||||||||||||||||||||
| 772 | |||||||||||||||||||||||||||||||||||||||||||
| 773 | 0 | return $self->{ALLOCATED}; | |||||||||||||||||||||||||||||||||||||||||
| 774 | } | ||||||||||||||||||||||||||||||||||||||||||
| 775 | |||||||||||||||||||||||||||||||||||||||||||
| 776 | 0 | ▶ | sub lastWritten { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
lastWritten: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 777 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 778 | |||||||||||||||||||||||||||||||||||||||||||
| 779 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 780 | 0 | $self->{LASTWRITTEN} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 781 | } | ||||||||||||||||||||||||||||||||||||||||||
| 782 | |||||||||||||||||||||||||||||||||||||||||||
| 783 | 0 | return $self->{LASTWRITTEN}; | |||||||||||||||||||||||||||||||||||||||||
| 784 | } | ||||||||||||||||||||||||||||||||||||||||||
| 785 | |||||||||||||||||||||||||||||||||||||||||||
| 786 | 0 | ▶ | sub lastRead { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
lastRead: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 787 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 788 | |||||||||||||||||||||||||||||||||||||||||||
| 789 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 790 | 0 | $self->{LASTREAD} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 791 | } | ||||||||||||||||||||||||||||||||||||||||||
| 792 | |||||||||||||||||||||||||||||||||||||||||||
| 793 | 0 | return $self->{LASTREAD}; | |||||||||||||||||||||||||||||||||||||||||
| 794 | } | ||||||||||||||||||||||||||||||||||||||||||
| 795 | |||||||||||||||||||||||||||||||||||||||||||
| 796 | # | ||||||||||||||||||||||||||||||||||||||||||
| 797 | # This refers to the date on which the youngest image on the volume expires | ||||||||||||||||||||||||||||||||||||||||||
| 798 | # and hence the earliest date on which the volume can be de-allocated | ||||||||||||||||||||||||||||||||||||||||||
| 799 | # Note to be confused with date on which the media itself expires and henceforth | ||||||||||||||||||||||||||||||||||||||||||
| 800 | # cano no longer be used for backups altogether. | ||||||||||||||||||||||||||||||||||||||||||
| 801 | 0 | ▶ | sub expires { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
expires: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 802 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 803 | |||||||||||||||||||||||||||||||||||||||||||
| 804 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 805 | 0 | $self->{LASTIMAGEEXPIRES} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 806 | } | ||||||||||||||||||||||||||||||||||||||||||
| 807 | |||||||||||||||||||||||||||||||||||||||||||
| 808 | 0 | return $self->{LASTIMAGEEXPIRES}; | |||||||||||||||||||||||||||||||||||||||||
| 809 | } | ||||||||||||||||||||||||||||||||||||||||||
| 810 | |||||||||||||||||||||||||||||||||||||||||||
| 811 | 0 | ▶ | sub status { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
status: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 812 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 813 | |||||||||||||||||||||||||||||||||||||||||||
| 814 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 815 | 0 | $self->{STATUS} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 816 | } | ||||||||||||||||||||||||||||||||||||||||||
| 817 | |||||||||||||||||||||||||||||||||||||||||||
| 818 | 0 | return $self->{STATUS}; | |||||||||||||||||||||||||||||||||||||||||
| 819 | } | ||||||||||||||||||||||||||||||||||||||||||
| 820 | |||||||||||||||||||||||||||||||||||||||||||
| 821 | 0 | ▶ | sub maxMounts { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
maxMounts: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 822 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 823 | |||||||||||||||||||||||||||||||||||||||||||
| 824 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 825 | 0 | my $maxMounts = shift; | |||||||||||||||||||||||||||||||||||||||||
| 826 | 0 | NBU->cmd("vmchange". | |||||||||||||||||||||||||||||||||||||||||
| 827 | " -m ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 828 | " -maxmounts $maxMounts", 0); | ||||||||||||||||||||||||||||||||||||||||||
| 829 | 0 | $self->{MAXMOUNTS} = $maxMounts; | |||||||||||||||||||||||||||||||||||||||||
| 830 | } | ||||||||||||||||||||||||||||||||||||||||||
| 831 | |||||||||||||||||||||||||||||||||||||||||||
| 832 | 0 | return $self->{MAXMOUNTS}; | |||||||||||||||||||||||||||||||||||||||||
| 833 | } | ||||||||||||||||||||||||||||||||||||||||||
| 834 | |||||||||||||||||||||||||||||||||||||||||||
| 835 | 0 | ▶ | sub frozen { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
frozen: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 836 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 837 | |||||||||||||||||||||||||||||||||||||||||||
| 838 | 0 | ▶ | return $self->allocated ? ($self->{STATUS} & 0x1) : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 839 | } | ||||||||||||||||||||||||||||||||||||||||||
| 840 | |||||||||||||||||||||||||||||||||||||||||||
| 841 | 0 | ▶ | sub freeze { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
freeze: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 842 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 843 | |||||||||||||||||||||||||||||||||||||||||||
| 844 | 0 | ▶ | if ($self->allocated && !($self->{STATUS} & 0x1)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->allocated and not $self->{"STATUS"} & 1
MC/DC0%0/2
$self->allocated and not $self->{"STATUS"} & 1
$self->allocated
not $self->{"STATUS"} & 1
Truth table0%0/3
A and not(B)
A= $self->allocatedB= not $self->{"STATUS"} & 1
| |||||||||||||||||||||||||||||||||||||||||||
| 845 | # issue freeze command: | ||||||||||||||||||||||||||||||||||||||||||
| 846 | 0 | NBU->cmd("bpmedia". | |||||||||||||||||||||||||||||||||||||||||
| 847 | " -h ".$self->mmdbHost->name. | ||||||||||||||||||||||||||||||||||||||||||
| 848 | " -ev ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 849 | " -freeze\n"); | ||||||||||||||||||||||||||||||||||||||||||
| 850 | 0 | $self->{STATUS} |= 0x1; | |||||||||||||||||||||||||||||||||||||||||
| 851 | } | ||||||||||||||||||||||||||||||||||||||||||
| 852 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 853 | } | ||||||||||||||||||||||||||||||||||||||||||
| 854 | |||||||||||||||||||||||||||||||||||||||||||
| 855 | 0 | ▶ | sub unfreeze { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unfreeze: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 856 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 857 | |||||||||||||||||||||||||||||||||||||||||||
| 858 | 0 | ▶ | if ($self->allocated && ($self->{STATUS} & 0x1)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->allocated and $self->{"STATUS"} & 1
MC/DC0%0/2
$self->allocated and $self->{"STATUS"} & 1
$self->allocated
$self->{"STATUS"} & 1
Truth table0%0/3
A and B
A= $self->allocatedB= $self->{"STATUS"} & 1
| |||||||||||||||||||||||||||||||||||||||||||
| 859 | # issue unfreeze command: | ||||||||||||||||||||||||||||||||||||||||||
| 860 | 0 | NBU->cmd("bpmedia". | |||||||||||||||||||||||||||||||||||||||||
| 861 | " -h ".$self->mmdbHost->name. | ||||||||||||||||||||||||||||||||||||||||||
| 862 | " -ev ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 863 | " -unfreeze\n"); | ||||||||||||||||||||||||||||||||||||||||||
| 864 | 0 | $self->{STATUS} &= ~0x11; | |||||||||||||||||||||||||||||||||||||||||
| 865 | } | ||||||||||||||||||||||||||||||||||||||||||
| 866 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 867 | } | ||||||||||||||||||||||||||||||||||||||||||
| 868 | |||||||||||||||||||||||||||||||||||||||||||
| 869 | 0 | ▶ | sub suspended { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
suspended: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 870 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 871 | |||||||||||||||||||||||||||||||||||||||||||
| 872 | 0 | ▶ | return $self->allocated ? ($self->{STATUS} & 0x2) : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 873 | } | ||||||||||||||||||||||||||||||||||||||||||
| 874 | |||||||||||||||||||||||||||||||||||||||||||
| 875 | 0 | ▶ | sub unsuspend { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unsuspend: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 876 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 877 | |||||||||||||||||||||||||||||||||||||||||||
| 878 | 0 | ▶ | if ($self->allocated && ($self->{STATUS} & 0x2)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->allocated and $self->{"STATUS"} & 2
MC/DC0%0/2
$self->allocated and $self->{"STATUS"} & 2
$self->allocated
$self->{"STATUS"} & 2
Truth table0%0/3
A and B
A= $self->allocatedB= $self->{"STATUS"} & 2
| |||||||||||||||||||||||||||||||||||||||||||
| 879 | # issue unfreeze command: | ||||||||||||||||||||||||||||||||||||||||||
| 880 | 0 | NBU->cmd("bpmedia". | |||||||||||||||||||||||||||||||||||||||||
| 881 | " -h ".$self->mmdbHost->name. | ||||||||||||||||||||||||||||||||||||||||||
| 882 | " -ev ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 883 | " -unfreeze\n"); | ||||||||||||||||||||||||||||||||||||||||||
| 884 | 0 | $self->{STATUS} &= ~0x2; | |||||||||||||||||||||||||||||||||||||||||
| 885 | } | ||||||||||||||||||||||||||||||||||||||||||
| 886 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 887 | } | ||||||||||||||||||||||||||||||||||||||||||
| 888 | |||||||||||||||||||||||||||||||||||||||||||
| 889 | # | ||||||||||||||||||||||||||||||||||||||||||
| 890 | # If a Media Manager allocates a volume only to fail to write to it, | ||||||||||||||||||||||||||||||||||||||||||
| 891 | # it is possible for the volume to be frozen without having any data | ||||||||||||||||||||||||||||||||||||||||||
| 892 | # written to it, i.e. it does not even have a valid header. This state of | ||||||||||||||||||||||||||||||||||||||||||
| 893 | # the volume is identified by status bit 4. | ||||||||||||||||||||||||||||||||||||||||||
| 894 | # This author has only observed this bit in conjunction with bit 0. As a | ||||||||||||||||||||||||||||||||||||||||||
| 895 | # matter of fact, unfreezing such a volume will also remove bit 4 | ||||||||||||||||||||||||||||||||||||||||||
| 896 | 0 | ▶ | sub unmountable { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unmountable: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 897 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 898 | |||||||||||||||||||||||||||||||||||||||||||
| 899 | 0 | ▶ | return (defined($self->{STATUS}) ? $self->{STATUS} & 0x10 : 0); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 900 | } | ||||||||||||||||||||||||||||||||||||||||||
| 901 | |||||||||||||||||||||||||||||||||||||||||||
| 902 | 0 | ▶ | sub multipleRetentions { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
multipleRetentions: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 903 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 904 | |||||||||||||||||||||||||||||||||||||||||||
| 905 | 0 | ▶ | return (defined($self->{STATUS}) ? $self->{STATUS} & 0x40 : 0); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 906 | } | ||||||||||||||||||||||||||||||||||||||||||
| 907 | |||||||||||||||||||||||||||||||||||||||||||
| 908 | 0 | ▶ | sub imported { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
imported: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 909 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 910 | |||||||||||||||||||||||||||||||||||||||||||
| 911 | 0 | ▶ | return (defined($self->{STATUS}) ? $self->{STATUS} & 0x80 : 0); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 912 | } | ||||||||||||||||||||||||||||||||||||||||||
| 913 | |||||||||||||||||||||||||||||||||||||||||||
| 914 | 0 | ▶ | sub mpx { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mpx: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 915 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 916 | |||||||||||||||||||||||||||||||||||||||||||
| 917 | 0 | ▶ | return (defined($self->{STATUS}) ? $self->{STATUS} & 0x200 : 0); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 918 | } | ||||||||||||||||||||||||||||||||||||||||||
| 919 | |||||||||||||||||||||||||||||||||||||||||||
| 920 | 0 | ▶ | sub offsiteSessionID { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
offsiteSessionID: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 921 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 922 | |||||||||||||||||||||||||||||||||||||||||||
| 923 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 924 | 0 | my $offsiteSessionID = shift; | |||||||||||||||||||||||||||||||||||||||||
| 925 | 0 | my $update; | |||||||||||||||||||||||||||||||||||||||||
| 926 | |||||||||||||||||||||||||||||||||||||||||||
| 927 | 0 | ▶ | if (defined($offsiteSessionID)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 928 | 0 | ▶ | $update = !defined($self->{OFFSITESESSIONID}) || ($offsiteSessionID ne $self->{OFFSITESESSIONID}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
!defined($self->{'OFFSITESESSIONID'}) || $offsiteSessionID ne $self->{'OFFSITESESSIONID'}
MC/DC0%0/2
!defined($self->{'OFFSITESESSIONID'}) || $offsiteSessionID ne $self->{'OFFSITESESSIONID'}
!defined($self->{'OFFSITESESSIONID'})
$offsiteSessionID ne $self->{'OFFSITESESSIONID'}
Truth table0%0/3
not(A) || B
A= !defined($self->{'OFFSITESESSIONID'})B= $offsiteSessionID ne $self->{'OFFSITESESSIONID'}
| |||||||||||||||||||||||||||||||||||||||||||
| 929 | } | ||||||||||||||||||||||||||||||||||||||||||
| 930 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 931 | 0 | $update = defined($self->{OFFSITESESSIONID}); | |||||||||||||||||||||||||||||||||||||||||
| 932 | } | ||||||||||||||||||||||||||||||||||||||||||
| 933 | 0 | ▶ | if ($update) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 934 | 0 | my @masters = NBU->masters; my $master = $masters[0]; | |||||||||||||||||||||||||||||||||||||||||
| 935 | 0 | ▶ | NBU->cmd("vmchange". | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 936 | " -h ".$master->name. | ||||||||||||||||||||||||||||||||||||||||||
| 937 | " -m ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 938 | " -offsid ".(defined($offsiteSessionID) ? $offsiteSessionID : "-"), 0); | ||||||||||||||||||||||||||||||||||||||||||
| 939 | 0 | $self->{OFFSITESESSIONID} = $offsiteSessionID; | |||||||||||||||||||||||||||||||||||||||||
| 940 | } | ||||||||||||||||||||||||||||||||||||||||||
| 941 | } | ||||||||||||||||||||||||||||||||||||||||||
| 942 | 0 | return $self->{OFFSITESESSIONID}; | |||||||||||||||||||||||||||||||||||||||||
| 943 | } | ||||||||||||||||||||||||||||||||||||||||||
| 944 | |||||||||||||||||||||||||||||||||||||||||||
| 945 | 0 | ▶ | sub offsiteReturnDate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
offsiteReturnDate: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 946 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 947 | |||||||||||||||||||||||||||||||||||||||||||
| 948 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 949 | 0 | my $offsiteReturnDate = shift; | |||||||||||||||||||||||||||||||||||||||||
| 950 | 0 | my $update; | |||||||||||||||||||||||||||||||||||||||||
| 951 | |||||||||||||||||||||||||||||||||||||||||||
| 952 | 0 | ▶ | if (defined($offsiteReturnDate)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 953 | 0 | ▶ | $update = !defined($self->{OFFSITERETURN}) || ($offsiteReturnDate ne $self->{OFFSITERETURN}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
!defined($self->{'OFFSITERETURN'}) || $offsiteReturnDate ne $self->{'OFFSITERETURN'}
MC/DC0%0/2
!defined($self->{'OFFSITERETURN'}) || $offsiteReturnDate ne $self->{'OFFSITERETURN'}
!defined($self->{'OFFSITERETURN'})
$offsiteReturnDate ne $self->{'OFFSITERETURN'}
Truth table0%0/3
not(A) || B
A= !defined($self->{'OFFSITERETURN'})B= $offsiteReturnDate ne $self->{'OFFSITERETURN'}
| |||||||||||||||||||||||||||||||||||||||||||
| 954 | } | ||||||||||||||||||||||||||||||||||||||||||
| 955 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 956 | 0 | $update = defined($self->{OFFSITERETURN}); | |||||||||||||||||||||||||||||||||||||||||
| 957 | } | ||||||||||||||||||||||||||||||||||||||||||
| 958 | 0 | ▶ | if ($update) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 959 | 0 | my @masters = NBU->masters; my $master = $masters[0]; | |||||||||||||||||||||||||||||||||||||||||
| 960 | 0 | ▶ | NBU->cmd("vmchange". | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 961 | " -h ".$master->name. | ||||||||||||||||||||||||||||||||||||||||||
| 962 | " -m ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 963 | " -offreturn ".(defined($offsiteReturnDate) ? NBU->date($offsiteReturnDate) : "0"), 0); | ||||||||||||||||||||||||||||||||||||||||||
| 964 | 0 | $self->{OFFSITERETURN} = $offsiteReturnDate; | |||||||||||||||||||||||||||||||||||||||||
| 965 | } | ||||||||||||||||||||||||||||||||||||||||||
| 966 | } | ||||||||||||||||||||||||||||||||||||||||||
| 967 | 0 | return $self->{OFFSITERETURN}; | |||||||||||||||||||||||||||||||||||||||||
| 968 | } | ||||||||||||||||||||||||||||||||||||||||||
| 969 | |||||||||||||||||||||||||||||||||||||||||||
| 970 | 0 | ▶ | sub offsiteSentDate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
offsiteSentDate: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 971 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 972 | |||||||||||||||||||||||||||||||||||||||||||
| 973 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 974 | 0 | my $offsiteSentDate = shift; | |||||||||||||||||||||||||||||||||||||||||
| 975 | 0 | my $update; | |||||||||||||||||||||||||||||||||||||||||
| 976 | |||||||||||||||||||||||||||||||||||||||||||
| 977 | 0 | ▶ | if (defined($offsiteSentDate)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 978 | 0 | ▶ | $update = !defined($self->{OFFSITESENT}) || ($offsiteSentDate ne $self->{OFFSITESENT}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
!defined($self->{'OFFSITESENT'}) || $offsiteSentDate ne $self->{'OFFSITESENT'}
MC/DC0%0/2
!defined($self->{'OFFSITESENT'}) || $offsiteSentDate ne $self->{'OFFSITESENT'}
!defined($self->{'OFFSITESENT'})
$offsiteSentDate ne $self->{'OFFSITESENT'}
Truth table0%0/3
not(A) || B
A= !defined($self->{'OFFSITESENT'})B= $offsiteSentDate ne $self->{'OFFSITESENT'}
| |||||||||||||||||||||||||||||||||||||||||||
| 979 | } | ||||||||||||||||||||||||||||||||||||||||||
| 980 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 981 | 0 | $update = defined($self->{OFFSITESENT}); | |||||||||||||||||||||||||||||||||||||||||
| 982 | } | ||||||||||||||||||||||||||||||||||||||||||
| 983 | 0 | ▶ | if ($update) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 984 | 0 | my @masters = NBU->masters; my $master = $masters[0]; | |||||||||||||||||||||||||||||||||||||||||
| 985 | 0 | ▶ | NBU->cmd("vmchange". | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 986 | " -h ".$master->name. | ||||||||||||||||||||||||||||||||||||||||||
| 987 | " -m ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 988 | " -offsent ".(defined($offsiteSentDate) ? NBU->date($offsiteSentDate) : "0"), 0); | ||||||||||||||||||||||||||||||||||||||||||
| 989 | 0 | $self->{OFFSITESENT} = $offsiteSentDate; | |||||||||||||||||||||||||||||||||||||||||
| 990 | } | ||||||||||||||||||||||||||||||||||||||||||
| 991 | } | ||||||||||||||||||||||||||||||||||||||||||
| 992 | 0 | return $self->{OFFSITESENT}; | |||||||||||||||||||||||||||||||||||||||||
| 993 | } | ||||||||||||||||||||||||||||||||||||||||||
| 994 | |||||||||||||||||||||||||||||||||||||||||||
| 995 | 0 | ▶ | sub offsiteLocation { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
offsiteLocation: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 996 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 997 | |||||||||||||||||||||||||||||||||||||||||||
| 998 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 999 | 0 | my $offsiteLocation = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1000 | 0 | my $update; | |||||||||||||||||||||||||||||||||||||||||
| 1001 | |||||||||||||||||||||||||||||||||||||||||||
| 1002 | 0 | ▶ | if (defined($offsiteLocation)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1003 | 0 | ▶ | $update = !defined($self->{OFFSITELOCATION}) || ($offsiteLocation ne $self->{OFFSITELOCATION}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
!defined($self->{'OFFSITELOCATION'}) || $offsiteLocation ne $self->{'OFFSITELOCATION'}
MC/DC0%0/2
!defined($self->{'OFFSITELOCATION'}) || $offsiteLocation ne $self->{'OFFSITELOCATION'}
!defined($self->{'OFFSITELOCATION'})
$offsiteLocation ne $self->{'OFFSITELOCATION'}
Truth table0%0/3
not(A) || B
A= !defined($self->{'OFFSITELOCATION'})B= $offsiteLocation ne $self->{'OFFSITELOCATION'}
| |||||||||||||||||||||||||||||||||||||||||||
| 1004 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1005 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 1006 | 0 | $update = defined($self->{OFFSITELOCATION}); | |||||||||||||||||||||||||||||||||||||||||
| 1007 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1008 | 0 | ▶ | if ($update) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1009 | 0 | my @masters = NBU->masters; my $master = $masters[0]; | |||||||||||||||||||||||||||||||||||||||||
| 1010 | 0 | ▶ | NBU->cmd("vmchange". | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1011 | " -h ".$master->name. | ||||||||||||||||||||||||||||||||||||||||||
| 1012 | " -m ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 1013 | " -offloc ".(defined($offsiteLocation) ? $offsiteLocation : "-"), 0); | ||||||||||||||||||||||||||||||||||||||||||
| 1014 | 0 | $self->{OFFSITELOCATION} = $offsiteLocation; | |||||||||||||||||||||||||||||||||||||||||
| 1015 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1016 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1017 | 0 | return $self->{OFFSITELOCATION}; | |||||||||||||||||||||||||||||||||||||||||
| 1018 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1019 | |||||||||||||||||||||||||||||||||||||||||||
| 1020 | 0 | ▶ | sub offsiteSlot { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
offsiteSlot: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 1021 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1022 | |||||||||||||||||||||||||||||||||||||||||||
| 1023 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1024 | 0 | my $offsiteSlot = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1025 | 0 | my $update; | |||||||||||||||||||||||||||||||||||||||||
| 1026 | |||||||||||||||||||||||||||||||||||||||||||
| 1027 | 0 | ▶ | if (defined($offsiteSlot)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1028 | 0 | ▶ | $update = !defined($self->{OFFSITESLOT}) || ($offsiteSlot ne $self->{OFFSITESLOT}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
!defined($self->{'OFFSITESLOT'}) || $offsiteSlot ne $self->{'OFFSITESLOT'}
MC/DC0%0/2
!defined($self->{'OFFSITESLOT'}) || $offsiteSlot ne $self->{'OFFSITESLOT'}
!defined($self->{'OFFSITESLOT'})
$offsiteSlot ne $self->{'OFFSITESLOT'}
Truth table0%0/3
not(A) || B
A= !defined($self->{'OFFSITESLOT'})B= $offsiteSlot ne $self->{'OFFSITESLOT'}
| |||||||||||||||||||||||||||||||||||||||||||
| 1029 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1030 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 1031 | 0 | $update = defined($self->{OFFSITESLOT}); | |||||||||||||||||||||||||||||||||||||||||
| 1032 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1033 | 0 | ▶ | if ($update) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1034 | 0 | my @masters = NBU->masters; my $master = $masters[0]; | |||||||||||||||||||||||||||||||||||||||||
| 1035 | 0 | ▶ | NBU->cmd("vmchange". | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1036 | " -h ".$master->name. | ||||||||||||||||||||||||||||||||||||||||||
| 1037 | " -m ".$self->id. | ||||||||||||||||||||||||||||||||||||||||||
| 1038 | " -offslot ".(defined($offsiteSlot) ? $offsiteSlot : "-"), 0); | ||||||||||||||||||||||||||||||||||||||||||
| 1039 | 0 | $self->{OFFSITESLOT} = $offsiteSlot; | |||||||||||||||||||||||||||||||||||||||||
| 1040 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1041 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1042 | 0 | return $self->{OFFSITESLOT}; | |||||||||||||||||||||||||||||||||||||||||
| 1043 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1044 | |||||||||||||||||||||||||||||||||||||||||||
| 1045 | # | ||||||||||||||||||||||||||||||||||||||||||
| 1046 | # Return true, that is a non-zero value, if the tape is indeed full. | ||||||||||||||||||||||||||||||||||||||||||
| 1047 | 0 | ▶ | sub full { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
full: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 1048 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1049 | |||||||||||||||||||||||||||||||||||||||||||
| 1050 | 0 | ▶ | return (defined($self->{STATUS}) ? $self->{STATUS} & 0x8 : 0); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1051 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1052 | |||||||||||||||||||||||||||||||||||||||||||
| 1053 | # | ||||||||||||||||||||||||||||||||||||||||||
| 1054 | # Is the volume allocated to backing up NetBackup itself? If not, then | ||||||||||||||||||||||||||||||||||||||||||
| 1055 | # it is "available" to the media managers | ||||||||||||||||||||||||||||||||||||||||||
| 1056 | 0 | ▶ | sub netbackup { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
netbackup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 1057 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1058 | |||||||||||||||||||||||||||||||||||||||||||
| 1059 | 0 | return $self->{NETBACKUP}; | |||||||||||||||||||||||||||||||||||||||||
| 1060 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1061 | 0 | ▶ | sub available { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
available: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 1062 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1063 | |||||||||||||||||||||||||||||||||||||||||||
| 1064 | 0 | return !$self->{NETBACKUP}; | |||||||||||||||||||||||||||||||||||||||||
| 1065 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1066 | |||||||||||||||||||||||||||||||||||||||||||
| 1067 | # | ||||||||||||||||||||||||||||||||||||||||||
| 1068 | # The particular value returned is the number of seconds elapsed since | ||||||||||||||||||||||||||||||||||||||||||
| 1069 | # the tape was taken into service (ALLOCATED) and when it was last written. | ||||||||||||||||||||||||||||||||||||||||||
| 1070 | # Think of this as the volume's retirement age :-) | ||||||||||||||||||||||||||||||||||||||||||
| 1071 | # Note that this value can in fact be zero even if the tape is full. | ||||||||||||||||||||||||||||||||||||||||||
| 1072 | 0 | ▶ | sub fillTime { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fillTime: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 1073 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1074 | |||||||||||||||||||||||||||||||||||||||||||
| 1075 | 0 | ▶ | return $self->full ? ($self->{LASTWRITTEN} - $self->{ALLOCATED}) : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1076 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1077 | |||||||||||||||||||||||||||||||||||||||||||
| 1078 | 0 | ▶ | sub eject { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
eject: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 1079 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1080 | |||||||||||||||||||||||||||||||||||||||||||
| 1081 | 0 | ▶ | if ($self->robot) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1082 | 0 | NBU->cmd("vmchange -res"." -m ".$self->id." -mt ".$self->id. | |||||||||||||||||||||||||||||||||||||||||
| 1083 | " -rn ".$self->robot->id." -rc1 ".$self->slot. | ||||||||||||||||||||||||||||||||||||||||||
| 1084 | " -rh ".$self->robot->host->name. | ||||||||||||||||||||||||||||||||||||||||||
| 1085 | " -e -sec 1", 0); | ||||||||||||||||||||||||||||||||||||||||||
| 1086 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 1087 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1088 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 1089 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 1090 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1091 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1092 | |||||||||||||||||||||||||||||||||||||||||||
| 1093 | 0 | ▶ | sub removable { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
removable: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 1094 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1095 | |||||||||||||||||||||||||||||||||||||||||||
| 1096 | 0 | ▶ | return (defined($self->{REMOVABLE}) ? $self->{REMOVABLE} : 0); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1097 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1098 | |||||||||||||||||||||||||||||||||||||||||||
| 1099 | # | ||||||||||||||||||||||||||||||||||||||||||
| 1100 | # Insert a single fragment into this volume's table of contents | ||||||||||||||||||||||||||||||||||||||||||
| 1101 | 0 | ▶ | sub insertFragment { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
insertFragment: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 1102 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1103 | 0 | my $index = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1104 | 0 | my $fragment = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1105 | |||||||||||||||||||||||||||||||||||||||||||
| 1106 | # | ||||||||||||||||||||||||||||||||||||||||||
| 1107 | # The table of contents has one entry per file on the tape | ||||||||||||||||||||||||||||||||||||||||||
| 1108 | 0 | ▶ | $self->{TOC} = [] if (!defined($self->{TOC})); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1109 | 0 | my $toc = $self->{TOC}; | |||||||||||||||||||||||||||||||||||||||||
| 1110 | |||||||||||||||||||||||||||||||||||||||||||
| 1111 | # | ||||||||||||||||||||||||||||||||||||||||||
| 1112 | # Non-removable media means disk storage unit "media". These only | ||||||||||||||||||||||||||||||||||||||||||
| 1113 | # contain a single fragment so we force the index to zero. | ||||||||||||||||||||||||||||||||||||||||||
| 1114 | 0 | ▶ | $index = 0 if (!$self->removable); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1115 | |||||||||||||||||||||||||||||||||||||||||||
| 1116 | # | ||||||||||||||||||||||||||||||||||||||||||
| 1117 | # In turn, a file on the tape can contain multiple fragments of images | ||||||||||||||||||||||||||||||||||||||||||
| 1118 | # whenever multiplexing is enabled, hence we keep so-called mpx lists for each | ||||||||||||||||||||||||||||||||||||||||||
| 1119 | # file. | ||||||||||||||||||||||||||||||||||||||||||
| 1120 | 0 | ▶ | $$toc[$index] = [] if (!defined($$toc[$index])); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1121 | 0 | my $mpxList = $$toc[$index]; | |||||||||||||||||||||||||||||||||||||||||
| 1122 | 0 | push @$mpxList, $fragment; | |||||||||||||||||||||||||||||||||||||||||
| 1123 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1124 | |||||||||||||||||||||||||||||||||||||||||||
| 1125 | # | ||||||||||||||||||||||||||||||||||||||||||
| 1126 | # Load the list of fragments for this volume into its table of | ||||||||||||||||||||||||||||||||||||||||||
| 1127 | # contents. | ||||||||||||||||||||||||||||||||||||||||||
| 1128 | 0 | ▶ | sub loadImages { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
loadImages: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 1129 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1130 | |||||||||||||||||||||||||||||||||||||||||||
| 1131 | 0 | ▶ | $self->{TOC} = [] if (!defined($self->{TOC})); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1132 | |||||||||||||||||||||||||||||||||||||||||||
| 1133 | 0 | ▶ | if (!$self->{MMLOADED} || ($self->allocated && ($self->expires > time))) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
not $self->{"MMLOADED"} or $self->allocated and $self->expires > time
$self->allocated and $self->expires > time
MC/DC0%0/3
not $self->{"MMLOADED"} or $self->allocated and $self->expires > time
not $self->{"MMLOADED"}
$self->allocated
$self->expires > time
Truth table0%0/4
not(A) or B and C
A= not $self->{"MMLOADED"}B= $self->allocatedC= $self->expires > time
| |||||||||||||||||||||||||||||||||||||||||||
| 1134 | 0 | NBU::Image->loadImages(NBU->cmd("bpimmedia -l -mediaid ".$self->id." |")); | |||||||||||||||||||||||||||||||||||||||||
| 1135 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1136 | 0 | return $self->{TOC}; | |||||||||||||||||||||||||||||||||||||||||
| 1137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1138 | |||||||||||||||||||||||||||||||||||||||||||
| 1139 | 0 | ▶ | sub tableOfContents { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
tableOfContents: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 1140 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 1141 | |||||||||||||||||||||||||||||||||||||||||||
| 1142 | 0 | ▶ | if (!defined($self->{TOC})) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 1143 | 0 | $self->loadImages; | |||||||||||||||||||||||||||||||||||||||||
| 1144 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1145 | |||||||||||||||||||||||||||||||||||||||||||
| 1146 | 0 | my $toc = $self->{TOC}; | |||||||||||||||||||||||||||||||||||||||||
| 1147 | 0 | return (@$toc); | |||||||||||||||||||||||||||||||||||||||||
| 1148 | } | ||||||||||||||||||||||||||||||||||||||||||
| 1149 | |||||||||||||||||||||||||||||||||||||||||||
| 1150 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 1151 | |||||||||||||||||||||||||||||||||||||||||||
| 1152 | __END__ | ||||||||||||||||||||||||||||||||||||||||||