From 6974fa8b0419bbd0711f79c8b78e07a9543810dd Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 1 Jul 2007 20:28:50 +0000 Subject: * activated 'use warnings' to all modules and adjusted all occurences of 'use of uninitialized values', a couple of which might still show up * adjusted all code with respect to passing perlcritic level 4 and 5 git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1207 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSExport/BlockDevice/AoE.pm | 15 ++++++--------- installer/OpenSLX/OSExport/BlockDevice/Base.pm | 10 ++++------ installer/OpenSLX/OSExport/BlockDevice/NBD.pm | 14 ++++++-------- 3 files changed, 16 insertions(+), 23 deletions(-) (limited to 'installer/OpenSLX/OSExport/BlockDevice') diff --git a/installer/OpenSLX/OSExport/BlockDevice/AoE.pm b/installer/OpenSLX/OSExport/BlockDevice/AoE.pm index c8aad4ec..2113ef5c 100644 --- a/installer/OpenSLX/OSExport/BlockDevice/AoE.pm +++ b/installer/OpenSLX/OSExport/BlockDevice/AoE.pm @@ -14,12 +14,11 @@ # ----------------------------------------------------------------------------- package OpenSLX::OSExport::BlockDevice::AoE; -use vars qw($VERSION); +use strict; +use warnings; + use base qw(OpenSLX::OSExport::BlockDevice::Base); -$VERSION = 1.01; # API-version . implementation-version -use strict; -use Carp; use File::Basename; use OpenSLX::Basics; use OpenSLX::ConfigDB qw(:support); @@ -32,7 +31,6 @@ use OpenSLX::Utils; # # - ################################################################################ ### interface methods ################################################################################ @@ -66,10 +64,9 @@ sub generateExportURI my $self = shift; my $export = shift; - my $server = - length($export->{server_ip}) - ? $export->{server_ip} - : generatePlaceholderFor('serverip'); + my $serverIP = $export->{server_ip} || ''; + my $server + = length($serverIP) ? $serverIP : generatePlaceholderFor('serverip'); $server .= ":$export->{port}" if length($export->{port}); return "aoe://$server"; diff --git a/installer/OpenSLX/OSExport/BlockDevice/Base.pm b/installer/OpenSLX/OSExport/BlockDevice/Base.pm index 938dc6db..ef59f86b 100644 --- a/installer/OpenSLX/OSExport/BlockDevice/Base.pm +++ b/installer/OpenSLX/OSExport/BlockDevice/Base.pm @@ -13,14 +13,12 @@ # ----------------------------------------------------------------------------- package OpenSLX::OSExport::BlockDevice::Base; -use vars qw($VERSION); -$VERSION = 1.01; # API-version . implementation-version - use strict; -use Carp; +use warnings; + +our $VERSION = 1.01; # API-version . implementation-version -use OpenSLX::Basics; -use OpenSLX::Utils; +use Carp qw(confess); ################################################################################ ### interface methods diff --git a/installer/OpenSLX/OSExport/BlockDevice/NBD.pm b/installer/OpenSLX/OSExport/BlockDevice/NBD.pm index 8afaa97f..89f10b66 100644 --- a/installer/OpenSLX/OSExport/BlockDevice/NBD.pm +++ b/installer/OpenSLX/OSExport/BlockDevice/NBD.pm @@ -14,12 +14,11 @@ # ----------------------------------------------------------------------------- package OpenSLX::OSExport::BlockDevice::NBD; -use vars qw($VERSION); +use strict; +use warnings; + use base qw(OpenSLX::OSExport::BlockDevice::Base); -$VERSION = 1.01; # API-version . implementation-version -use strict; -use Carp; use File::Basename; use OpenSLX::Basics; use OpenSLX::ConfigDB qw(:support); @@ -59,10 +58,9 @@ sub generateExportURI my $self = shift; my $export = shift; - my $server = - length($export->{server_ip}) - ? $export->{server_ip} - : generatePlaceholderFor('serverip'); + my $serverIP = $export->{server_ip} || ''; + my $server + = length($serverIP) ? $serverIP : generatePlaceholderFor('serverip'); $server .= ":$export->{port}" if length($export->{port}); return "nbd://$server"; -- cgit v1.2.3-55-g7522