Author: arkurth
Date: Wed May  3 22:54:18 2017
New Revision: 1793729

URL: http://svn.apache.org/viewvc?rev=1793729&view=rev
Log:
VCL-887
Cleaned up inconsistent code formatting:
* Random mixed-case variable name: Total_days, IPaddress
* Spacing before/after if statements, parenthesis, etc.

Modified:
    vcl/trunk/managementnode/lib/VCL/Module.pm
    vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
    vcl/trunk/managementnode/lib/VCL/Module/OS/OSX.pm
    vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/Lab.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt/KVM.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/one.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vbox.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm
    vcl/trunk/managementnode/lib/VCL/Module/Semaphore.pm
    vcl/trunk/managementnode/lib/VCL/blockrequest.pm
    vcl/trunk/managementnode/lib/VCL/healthcheck.pm
    vcl/trunk/managementnode/lib/VCL/image.pm
    vcl/trunk/managementnode/lib/VCL/reclaim.pm
    vcl/trunk/managementnode/lib/VCL/utils.pm

Modified: vcl/trunk/managementnode/lib/VCL/Module.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module.pm Wed May  3 22:54:18 2017
@@ -2315,7 +2315,7 @@ sub setup_test_rpc_xml {
        
        my $response = xmlrpc_call(@xmlrpc_arguments);
        if ($response && $response->value) {
-               print "SUCCESS: RPC-XML access is configured correctly\n" . 
format_data($response->value) . "\n" if($verbose == 1);
+               print "SUCCESS: RPC-XML access is configured correctly\n" . 
format_data($response->value) . "\n" if ($verbose == 1);
                return 1;
        }
        

Modified: vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Wed May  3 22:54:18 2017
@@ -54,10 +54,10 @@ use diagnostics;
 no warnings 'redefine';
 
 use VCL::utils;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 use Net::Netmask;
 use File::Basename;
-use File::Temp qw( tempfile mktemp );
+use File::Temp qw(tempfile mktemp);
 
 ##############################################################################
 
@@ -2912,7 +2912,7 @@ sub create_user {
                my $home_directory_root = "/home";
                my $home_directory_path = "$home_directory_root/$username";
                my $home_directory_on_local_disk = 
$self->is_file_on_local_disk($home_directory_root);
-               if ($home_directory_on_local_disk ) {
+               if ($home_directory_on_local_disk) {
                        my $useradd_command = "/usr/sbin/useradd -s /bin/bash 
-m -d /home/$username -g vcl";
                        $useradd_command .= " -u $uid" if ($uid);
                        $useradd_command .= " $username";
@@ -2944,8 +2944,8 @@ sub create_user {
        }
 
        # Process connect_methods
-       if($self->can("grant_connect_method_access")) {
-               if(!$self->grant_connect_method_access({
+       if ($self->can("grant_connect_method_access")) {
+               if (!$self->grant_connect_method_access({
                        username => $username,
                        uid => $uid,
                        ssh_public_keys => $ssh_public_keys,

Modified: vcl/trunk/managementnode/lib/VCL/Module/OS/OSX.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/OS/OSX.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/OS/OSX.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/OS/OSX.pm Wed May  3 22:54:18 2017
@@ -142,7 +142,7 @@ sub pre_capture {
 
        notify($ERRORS{'OK'}, 0, "beginning OSX image PRE_CAPTURE() preparation 
tasks on $computer_node_name");
 
-       # copy pre_capture configuration files to the computer ( scripts, etc )
+       # copy pre_capture configuration files to the computer (scripts, etc)
        if (!$self->copy_capture_configuration_files()) {
                notify($ERRORS{'WARNING'}, 0, "unable to copy OSX script files 
to $computer_node_name");
                return 0;
@@ -693,7 +693,7 @@ sub enable_firewall_port {
        my $rule=0;
        my $upper_limit=12300;
        my $found=0;
-       while ( $rule == 0  &&  $upper_limit > 0 ) {
+       while ($rule == 0  &&  $upper_limit > 0) {
                foreach my $line (@{$output}) {
                        if ($line =~ /^$upper_limit\s+/) {
                                $found=1;
@@ -1040,7 +1040,7 @@ sub delete_user {
                return 0;
        }
        
-       if ( $user_login_id eq "root" || $user_login_id eq "administrator" ) {
+       if ($user_login_id eq "root" || $user_login_id eq "administrator" ) {
                notify($ERRORS{'WARNING'}, 0, "$user_login_id MUST not be 
deleted");
                return 0;
        }

Modified: vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Wed May  3 22:54:18 
2017
@@ -1216,7 +1216,7 @@ sub grant_access {
        my $system32_path        = $self->get_system32_path();
        my $request_forimaging   = $self->data->get_request_forimaging();
        
-       if ($self->process_connect_methods("", 1) ) {
+       if ($self->process_connect_methods("", 1)) {
                notify($ERRORS{'OK'}, 0, "processed connection methods on 
$computer_node_name");
        }
        else {
@@ -8499,7 +8499,7 @@ sub set_static_public_address {
        # Make sure public IP configuration is static or this is a server 
request
        my $ip_configuration = 
$self->data->get_management_node_public_ip_configuration();
        if ($ip_configuration !~ /static/i) {
-               if ( !$server_request_fixed_ip ) {
+               if (!$server_request_fixed_ip) {
                        notify($ERRORS{'WARNING'}, 0, "static public address 
can only be set if IP configuration is static, current value: $ip_configuration 
\nserver_request_fixed_ip=$server_request_fixed_ip");
                        return;
                }
@@ -8884,7 +8884,7 @@ sub configure_time_synchronization {
                $time_source = get_variable($variable_name);
                notify($ERRORS{'DEBUG'}, 0, "time_source is $time_source  set 
for $variable_name");
        }
-       elsif (is_variable_set($variable_name_global) ) {
+       elsif (is_variable_set($variable_name_global)) {
                $time_source = get_variable($variable_name_global);
                notify($ERRORS{'DEBUG'}, 0, "time_source is $time_source  set 
for $variable_name");
        }

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning.pm Wed May  3 22:54:18 
2017
@@ -51,7 +51,7 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 use File::Basename;
 
 use VCL::utils;

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/Lab.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/Lab.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/Lab.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/Lab.pm Wed May  3 
22:54:18 2017
@@ -51,7 +51,7 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 
 use VCL::utils;
 

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm 
(original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm Wed 
May  3 22:54:18 2017
@@ -57,11 +57,11 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 use IO::File;
 use Fcntl qw(:DEFAULT :flock);
-use File::Temp qw( tempfile );
-use List::Util qw( max );
+use File::Temp qw(tempfile);
+use List::Util qw(max);
 use Storable qw(dclone);
 use Term::ANSIColor 2.00 qw(:constants colored);
 

Modified: 
vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm 
(original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm 
Wed May  3 22:54:18 2017
@@ -55,9 +55,9 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
-use File::Temp qw( tempdir );
-use List::Util qw( max );
+use English qw(-no_match_vars);
+use File::Temp qw(tempdir);
+use List::Util qw(max);
 
 use VCL::utils;
 
@@ -627,7 +627,7 @@ sub copy_virtual_disk {
        }
        
        # Check the disk type argument, the string must match exactly or the 
copy will fail
-       my @valid_disk_types = qw( eagerZeroedThick flatMonolithic preallocated 
raw rdm rdmp sparse2Gb sparseMonolithic thick thick2Gb thin );
+       my @valid_disk_types = qw(eagerZeroedThick flatMonolithic preallocated 
raw rdm rdmp sparse2Gb sparseMonolithic thick thick2Gb thin);
        if (!grep(/^$destination_disk_type$/, @valid_disk_types)) {
                notify($ERRORS{'WARNING'}, 0, "disk type argument is not valid: 
'$destination_disk_type', it must exactly match (case sensitive) one of the 
following strings:\n" . join("\n", @valid_disk_types));
                return;
@@ -1908,7 +1908,7 @@ sub get_file_contents {
        
        # Create a temp directory to store the file and construct the temp file 
path
        # The temp directory is automatically deleted then this variable goes 
out of scope
-       my $temp_directory_path = tempdir( CLEANUP => 1 );
+       my $temp_directory_path = tempdir(CLEANUP => 1);
        my $source_file_name = $self->_get_file_name($path);
        my $temp_file_path = "$temp_directory_path/$source_file_name";
        

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm Wed May  3 
22:54:18 2017
@@ -54,7 +54,7 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 use File::Basename;
 
 use VCL::utils;
@@ -2875,7 +2875,7 @@ sub get_master_xml_device_info {
        
        if (!defined($self->{master_xml_device_info})) {
                my $master_xml_info = $self->get_master_xml_info() || return;
-               if(scalar(keys %$master_xml_info) == 0) {
+               if (scalar(keys %$master_xml_info) == 0) {
                        return;
                }
                
@@ -2885,15 +2885,15 @@ sub get_master_xml_device_info {
                        notify($ERRORS{'WARNING'}, 0, "failed to retrieve 
device info from master XML file: $master_xml_file_path, 'devices' key is 
missing:\n" . format_data($master_xml_info));
                        return;
                }
-               elsif(!ref($devices_array_ref) || ref($devices_array_ref) ne 
'ARRAY') {
+               elsif (!ref($devices_array_ref) || ref($devices_array_ref) ne 
'ARRAY') {
                        notify($ERRORS{'WARNING'}, 0, "failed to retrieve 
device info from master XML file: $master_xml_file_path, 'devices' key is not 
an array reference:\n" . format_data($master_xml_info));
                        return;
                }
-               elsif(scalar(@$devices_array_ref) == 0) {
+               elsif (scalar(@$devices_array_ref) == 0) {
                        notify($ERRORS{'WARNING'}, 0, "failed to retrieve 
device info from master XML file: $master_xml_file_path, 'devices' array 
reference is empty:\n" . format_data($master_xml_info));
                        return;
                }
-               elsif(scalar(@$devices_array_ref) > 1) {
+               elsif (scalar(@$devices_array_ref) > 1) {
                        notify($ERRORS{'WARNING'}, 0, "retrieved device info 
from master XML file: $master_xml_file_path, 'devices' array reference contains 
multiple values:\n" . format_data($devices_array_ref));
                }
                

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt/KVM.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt/KVM.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt/KVM.pm 
(original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt/KVM.pm Wed May 
 3 22:54:18 2017
@@ -50,7 +50,7 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 use File::Basename;
 
 use VCL::utils;

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/one.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/one.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/one.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/one.pm Wed May  3 
22:54:18 2017
@@ -51,7 +51,7 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 
 use VCL::utils;
 use Fcntl qw(:DEFAULT :flock);
@@ -316,7 +316,7 @@ sub capture {
                $old_image_name = $self->_one_get_vm_disk($vmid);
                
                my @savedisk = $one{'server'}->call('one.vm.savedisk', 
$one{'auth'},$vmid,0,$image_name,'OS',$one{'false'});
-               if ( $savedisk[0][0]->value() ) {
+               if ($savedisk[0][0]->value()) {
                        notify($ERRORS{'OK'}, 0, "VM $vmid will be captured as 
$image_name");
                        
                } else {
@@ -342,7 +342,7 @@ sub capture {
        }
        
        # pre_capture was called with {end_state => 'on'}. Need to shutdown VM 
via ACPI.
-       if(!$self->power_off()) {
+       if (!$self->power_off()) {
                notify($ERRORS{'CRITICAL'}, 0, "Couldn't shutdown 
$computer_name with power_off()");
                return 0;
        } else {
@@ -451,7 +451,7 @@ sub capture {
                                        my $template = $data->{TEMPLATE};
                                        $template->{NAME} = $image_name;
                                        
-                                       if ( (ref($template->{DISK})) eq 
"ARRAY" ) { # template has multiple disks, update [0]
+                                       if ((ref($template->{DISK})) eq "ARRAY" 
) { # template has multiple disks, update [0]
                                                $template->{DISK}[0]{IMAGE_ID} 
= $one_new_image_id;
                                        } else { #template has one disk
                                                $template->{DISK}{IMAGE_ID} = 
$one_new_image_id;
@@ -468,7 +468,7 @@ sub capture {
                        }
                        return 1;
                }
-               if ( $wait_time <= 0 ) {
+               if ($wait_time <= 0) {
                        notify($ERRORS{'CRITICAL'}, 0, "disk save failed, image 
id $one_new_image_id is NOT READY. Fail.");
                        return 0;
                }       
@@ -509,7 +509,7 @@ sub power_off {
                @poweroff = $one{'server'}->call('one.vm.action', 
$one{'auth'},'shutdown',$vmid);
        }
        
-       if ( $poweroff[0][0]->value() ) {
+       if ($poweroff[0][0]->value()) {
                notify($ERRORS{'OK'}, 0, "Sent shutdown signal to VM $vmid");
                return 1;
        } else {
@@ -533,7 +533,7 @@ sub power_reset() {
        my $vmid = $self->_one_get_object_id("computer",$computer_name);
        my @poweroff = $one{'server'}->call('one.vm.action', 
$one{'auth'},'reboot',$vmid);
        
-       if ( $poweroff[0][0]->value() ) {
+       if ($poweroff[0][0]->value()) {
                notify($ERRORS{'OK'}, 0, "Sent reboot signal to VM $vmid");
                return 1;
        } else {
@@ -568,7 +568,7 @@ sub power_status {
        my $vmid = $self->_one_get_object_id("computer",$computer_name);
        
        my @result = $one{'server'}->call('one.vm.info', $one{'auth'},$vmid);
-       if ( $result[0][0]->value() ) {
+       if ($result[0][0]->value()) {
                my $data = $xml->XMLin($result[0][1]);
                if ($data->{STATE} == 3) {
                        if ($data->{LCM_STATE} == 3) {
@@ -632,7 +632,7 @@ sub _one_get_image_tag_value {
        
        my $imid = $self->_one_get_object_id("image",$image_name);
        my @result = $one{server}->call('one.image.info',$one{'auth'},$imid);
-       if ( $result[0][0]->value() ) {
+       if ($result[0][0]->value()) {
                my $data = $xml->XMLin($result[0][1]);
                
                if ($tag eq 'SIZE') {
@@ -723,7 +723,7 @@ sub _one_get_virtio {
        
        my @reply = 
$one{'server'}->call('one.image.info',$one{'auth'},$one_image_id);
        
-       if ( $reply[0][0]->value() ) {
+       if ($reply[0][0]->value()) {
                my $data = $xml->XMLin($reply[0][1]);
                if ($data->{TEMPLATE}{DEV_PREFIX} eq 'vd' ) {
                        return ',MODEL="virtio"';
@@ -768,7 +768,7 @@ sub _one_wait_for_vm_state {
                notify($ERRORS{'OK'}, 0, "Check state of VM $vmid ...");
                my $ttime;
                my $one_vm_state = $self->_one_get_vm_state($vmid);
-               if ( $self->_one_get_vm_state($vmid) == $num_state ) {
+               if ($self->_one_get_vm_state($vmid) == $num_state) {
                        notify($ERRORS{'OK'}, 0, "VM $vmid is in $state state");
                        return 1;
                } else {
@@ -792,7 +792,7 @@ sub _one_get_vm_state {
        my $vmid = shift;
        
        my @result = $one{'server'}->call('one.vm.info', $one{'auth'},$vmid);
-       if ( $result[0][0]->value() ) {
+       if ($result[0][0]->value()) {
                my $data = $xml->XMLin($result[0][1]);
                return $data->{STATE}; 
        } else {
@@ -807,7 +807,7 @@ sub _one_get_vm_lcm_state {
        my $vmid = shift;
        
        my @result = $one{'server'}->call('one.vm.info', $one{'auth'},$vmid);
-       if ( $result[0][0]->value() ) {
+       if ($result[0][0]->value()) {
                my $data = $xml->XMLin($result[0][1]);
                if ($data->{STATE} == 3) {
                        return $data->{LCM_STATE}; 
@@ -826,7 +826,7 @@ sub _one_get_image_state {
        my $image_id = shift;
        
        my @status = 
$one{'server'}->call('one.image.info',$one{'auth'},$image_id);
-       if ( $status[0][0]->value() ) {
+       if ($status[0][0]->value()) {
                my $data = $xml->XMLin($status[0][1]);
                return $data->{STATE};
        } else {
@@ -851,11 +851,11 @@ sub _one_get_object_id {
        if ($o_type eq "computer") {
                notify($ERRORS{'OK'}, 0, "Searching for running VM $o_name 
...");
                my @reply = 
$one{'server'}->call('one.vmpool.info',$one{'auth'},-3,-1,-1,-1);
-               if ( $reply[0][0]->value() ) {
+               if ($reply[0][0]->value()) {
                        
                        my $data = $xml->XMLin($reply[0][1]);
                        
-                       if ( (ref($data->{VM})) eq "ARRAY"){
+                       if ((ref($data->{VM})) eq "ARRAY") {
                                foreach (@{$data->{VM}}) {
                                        if ($_->{NAME} =~ /^$o_name\s/) {
                                                notify($ERRORS{'OK'}, 0, "Found 
".$_->{NAME}." matching $o_name in ARRAY");
@@ -863,7 +863,7 @@ sub _one_get_object_id {
                                        }
                                }
                        } else { #HASH, found only one entry
-                               unless ( defined($data->{VM}{NAME}) ) {return 
0;}
+                               unless (defined($data->{VM}{NAME})) {return 0;}
                                
                                if ($data->{VM}{NAME} =~ /^$o_name\s/) {
                                        notify($ERRORS{'OK'}, 0, "Found 
".$data->{VM}{NAME}." matching $o_name in HASH");
@@ -876,10 +876,10 @@ sub _one_get_object_id {
                }       
        } elsif ($o_type eq "image") {
                my @reply = $one{'server'}->call('one.imagepool.info', 
$one{'auth'},-3,-1,-1);
-               if ( $reply[0][0]->value() ) {
+               if ($reply[0][0]->value()) {
                        
                        my $rs_data = $xml->XMLin($reply[0][1]);
-                               if ( (ref($rs_data->{IMAGE})) eq "ARRAY" ) {
+                               if ((ref($rs_data->{IMAGE})) eq "ARRAY" ) {
                                        foreach (@{$rs_data->{IMAGE}}) {
                                                if ($_->{NAME} eq $o_name) {
                                                        return $_->{ID};
@@ -941,7 +941,7 @@ sub _one_delete_vm {
        my @reply;
        
        @reply = $one{'server'}->call('one.vm.action', 
$one{'auth'},'delete',$vmid);
-       if ( $reply[0][0]->value() ) {
+       if ($reply[0][0]->value()) {
                notify($ERRORS{'OK'}, 0, "ONE VM $vmid deleted");
        } else {
                notify($ERRORS{'CRITICAL'}, 0, $reply[0][1]);
@@ -955,7 +955,7 @@ sub _one_create_vm {
        my $self = shift;
        my $VM_TEMPLATE = shift;
        my @vm_allocate = 
$one{'server'}->call('one.vm.allocate',$one{'auth'},$VM_TEMPLATE,$one{'false'});
-       if ( $vm_allocate[0][0]->value() ) {    
+       if ($vm_allocate[0][0]->value()) {      
                return $vm_allocate[0][1];
        } else {
                notify($ERRORS{'CRITICAL'}, 0, "Error while making 
one.vm.allocate call : $vm_allocate[0][1]");
@@ -987,7 +987,7 @@ sub _one_get_vm_disk {
        if ($vm_info[0][0]->value()) {
                my $data = $xml->XMLin($vm_info[0][1]);
                
-               if ( (ref($data->{TEMPLATE}{DISK})) eq "ARRAY" ) { # template 
has multiple disks, return [0]
+               if ((ref($data->{TEMPLATE}{DISK})) eq "ARRAY" ) { # template 
has multiple disks, return [0]
                        return $data->{TEMPLATE}{DISK}[0]{IMAGE};
                } else { #template has one disk
                        return $data->{TEMPLATE}{DISK}{IMAGE};

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm Wed May  
3 22:54:18 2017
@@ -54,11 +54,11 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 use IO::File;
 use Fcntl qw(:DEFAULT :flock);
-use File::Temp qw( tempfile );
-use List::Util qw( max );
+use File::Temp qw(tempfile);
+use List::Util qw(max);
 use VCL::utils;
 use JSON qw(from_json to_json);
 use LWP::UserAgent;

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vbox.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vbox.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vbox.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vbox.pm Wed May  3 
22:54:18 2017
@@ -51,7 +51,7 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 
 use VCL::utils;
 use Fcntl qw(:DEFAULT :flock);

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm Wed May  3 
22:54:18 2017
@@ -58,7 +58,7 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 
 use VCL::utils;
 use Fcntl qw(:DEFAULT :flock);
@@ -341,7 +341,7 @@ sub load {
                        
                        if (my ($dhcpack_line) = grep(/DHCPACK/i, @dhcp_lines)) 
{
                                notify($ERRORS{'DEBUG'}, 0, 
"$computer_node_name acquired DHCP lease: '$dhcpack_line'");
-                               if(!$dhcp_ack) {
+                               if (!$dhcp_ack) {
                                        insertloadlog($reservation_id, 
$computer_id, "xcatstage2", "acquired DHCP lease");
                                        insertloadlog($reservation_id, 
$computer_id, "xcatround2", "waiting for boot flag");
                                        $dhcp_ack=1;

Modified: vcl/trunk/managementnode/lib/VCL/Module/Semaphore.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Semaphore.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Semaphore.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Semaphore.pm Wed May  3 22:54:18 
2017
@@ -59,7 +59,7 @@ use strict;
 use warnings;
 use diagnostics;
 
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 use IO::File;
 use Fcntl qw(:flock);
 

Modified: vcl/trunk/managementnode/lib/VCL/blockrequest.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/blockrequest.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/blockrequest.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/blockrequest.pm Wed May  3 22:54:18 2017
@@ -220,7 +220,7 @@ sub process {
                                notify($ERRORS{'OK'}, 0, "success blockTimes id 
$blocktime_id already processed");
                        }
                        
-                       sleep 5 if(!$completed);
+                       sleep 5 if (!$completed);
                }
                
                my $body;
@@ -236,8 +236,8 @@ sub process {
                        $body .= "Environment name = $image_prettyname\n";
                        $body .= "Allocated = $allocated\n"; 
                        $body .= "Block requested = 
$blockrequest_number_machines\n"; 
-                       $body .= "xmlrpc warn msg = $warningmsg\n" 
if(defined($warningmsg));
-                       $body .= "xmlrpc error msg = $errormsg\n" 
if(defined($errormsg));
+                       $body .= "xmlrpc warn msg = $warningmsg\n" if 
(defined($warningmsg));
+                       $body .= "xmlrpc error msg = $errormsg\n" if 
(defined($errormsg));
                        $body .= "\n";
                        
                        notify($ERRORS{'CRITICAL'}, 0, "$body");
@@ -367,20 +367,20 @@ sub process_block_time {
        my $xml_ret = xmlrpc_call(@argument_string);
 
        my %info;
-       if ( ref($xml_ret) =~ /STRUCT/i) {
+       if (ref($xml_ret) =~ /STRUCT/i) {
                $info{status} = $xml_ret->value->{status};
-               $info{allocated} = $xml_ret->value->{allocated} 
if(defined($xml_ret->value->{allocated})) ;
-               $info{unallocated} = $xml_ret->value->{unallocated} 
if(defined($xml_ret->value->{unallocated}));
+               $info{allocated} = $xml_ret->value->{allocated} if 
(defined($xml_ret->value->{allocated})) ;
+               $info{unallocated} = $xml_ret->value->{unallocated} if 
(defined($xml_ret->value->{unallocated}));
                #error
-               $info{errorcode} = $xml_ret->value->{errorcode} 
if(defined($xml_ret->value->{errorcode}));
-               $info{errormsg} = $xml_ret->value->{errormsg} 
if(defined($xml_ret->value->{errormsg}));
+               $info{errorcode} = $xml_ret->value->{errorcode} if 
(defined($xml_ret->value->{errorcode}));
+               $info{errormsg} = $xml_ret->value->{errormsg} if 
(defined($xml_ret->value->{errormsg}));
                #warning
-               $info{warningcode} = $xml_ret->value->{warningcode} 
if(defined($xml_ret->value->{warningcode}));
-               $info{warningmsg} = $xml_ret->value->{warningmsg} 
if(defined($xml_ret->value->{warningmsg}));
+               $info{warningcode} = $xml_ret->value->{warningcode} if 
(defined($xml_ret->value->{warningcode}));
+               $info{warningmsg} = $xml_ret->value->{warningmsg} if 
(defined($xml_ret->value->{warningmsg}));
                #$info{reqidlists} = $xml_ret->value->{requestids};
                }
        else {
-               notify($ERRORS{'WARNING'}, 0, "return argument 
XMLRPCprocessBlockTime was not a STRUCT as expected" . ref($xml_ret) );
+               notify($ERRORS{'WARNING'}, 0, "return argument 
XMLRPCprocessBlockTime was not a STRUCT as expected" . ref($xml_ret));
                if (ref($xml_ret) =~ /fault/) {
                        $info{status} = "fault";
                }

Modified: vcl/trunk/managementnode/lib/VCL/healthcheck.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/healthcheck.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/healthcheck.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/healthcheck.pm Wed May  3 22:54:18 2017
@@ -51,7 +51,7 @@ use 5.008000;
 use strict;
 use warnings;
 use diagnostics;
-use English qw( -no_match_vars );
+use English qw(-no_match_vars);
 
 use VCL::utils;
 use VCL::DataStructure;
@@ -229,7 +229,7 @@ sub process {
                        #next;
                        $computer_short_name = $computer_hostname;
                }
-               #next if($computer_type eq "blade");
+               #next if ($computer_type eq "blade");
                #next if ($computer_type eq "virtualmachine");
                
                my %node_status;
@@ -245,7 +245,7 @@ sub process {
                my $node_status_string = "reload";
                
                notify($ERRORS{'OK'}, 0, "pinging node $computer_short_name ");
-               if (_pingnode($computer_short_name) ) {
+               if (_pingnode($computer_short_name)) {
                        $node_status{ping} = 1;  
                        # Try nmap to see if any of the ssh ports are open 
before attempting to run a test command
                        my $port_22_status = nmap_port($computer_short_name, 
22) ? "open" : "closed";
@@ -290,14 +290,14 @@ sub process {
                                my @currentimage_txt_contents = 
get_current_image_contents_no_data_structure($computer_short_name);
                                foreach my $l (@currentimage_txt_contents) {
                                        #notify($ERRORS{'OK'}, 0, "NODE l=$l");
-                                       if ( $l =~ /imagerevision_id/i ) {
+                                       if ($l =~ /imagerevision_id/i) {
                                                chomp($l);
                                                my ($b,$imagerevision_id) = 
split(/=/,$l);
                                                $node_status{imagerevision_id} 
= $imagerevision_id;
                                                $node_status_string = 
"post_load";
                                                $node_status{status} = 
"post_load";
                                        }
-                                       if ($l =~ /vcld_post_load/ ) {
+                                       if ($l =~ /vcld_post_load/) {
                                                $node_status_string = "ready";
                                                $node_status{status} = "ready";
                                        }

Modified: vcl/trunk/managementnode/lib/VCL/image.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/image.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/image.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/image.pm Wed May  3 22:54:18 2017
@@ -596,7 +596,7 @@ sub setup_capture_base_image {
                # if 0 selected, delete all reservations related to 
$computer_node_name
                # Set $computer_node_name to available, proceed with questions
                my $epoch_time = convert_to_epoch_seconds;
-               if ($chosen_request_id == 0 ) {
+               if ($chosen_request_id == 0) {
                        delete $existing_requests_array_choices{0};
                        
                        foreach my $request_id_del (sort keys 
%existing_requests_array_choices) {
@@ -812,7 +812,7 @@ EOF
 INSERT INTO imagerevision
 (imageid, revision, userid, datecreated, deleted, production, imagename)
 VALUES
-($image_id, '0', '$user_id', NOW( ), '1', '1', '$image_name')
+($image_id, '0', '$user_id', NOW(), '1', '1', '$image_name')
 EOF
 
        my $imagerevision_id = 
database_execute($insert_imagerevision_statement);
@@ -882,7 +882,7 @@ EOF
                while (my $output = <COMMAND>) {
                        if ($output =~ /$reservation_id/) {
                                print $output;
-                               if ($output =~ /complete/i ) {
+                               if ($output =~ /complete/i) {
                                        last;
                                }
                        }

Modified: vcl/trunk/managementnode/lib/VCL/reclaim.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/reclaim.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/reclaim.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/reclaim.pm Wed May  3 22:54:18 2017
@@ -265,7 +265,7 @@ sub insert_reload_and_exit {
                }
        }
        else {
-       #elsif ( $action =~ /reload/i ) {
+       #elsif ($action =~ /reload/i) {
                if (!$next_image_name || !$next_image_id || 
!$next_imagerevision_id) {
                        notify($ERRORS{'WARNING'}, 0, "predictor module did not 
return required information, calling get_next_image_default from utils");
                        ($next_image_name, $next_image_id, 
$next_imagerevision_id) = get_next_image_default($computer_id);

Modified: vcl/trunk/managementnode/lib/VCL/utils.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=1793729&r1=1793728&r2=1793729&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/utils.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/utils.pm Wed May  3 22:54:18 2017
@@ -922,7 +922,7 @@ sub check_endtimenotice_interval {
        $diff_seconds -= $diff_weeks * 604800;
        
        my $diff_days = int($diff_seconds/86400);
-       my $Total_days = int($epoch_until_end/86400);
+       my $total_days = int($epoch_until_end/86400);
        $diff_seconds -= $diff_days * 86400;
        
        my $diff_hours = int($diff_seconds/3600);
@@ -939,27 +939,27 @@ sub check_endtimenotice_interval {
                return 0;
        }
        #2 week: between 14 days and a 14 day -6 minutes window
-       elsif ($Total_days >= 13 && $diff_hours >= 23 && $diff_minutes >= 55) {
+       elsif ($total_days >= 13 && $diff_hours >= 23 && $diff_minutes >= 55) {
                return "2 weeks";
        }
        #Ignore: between 7 days and 14 day - 6 minute window
-       elsif ($Total_days >=7) {
+       elsif ($total_days >=7) {
                return 0;
        }
        # 1 week notice: between 7 days and a 7 day -6 minute window
-       elsif ($Total_days >= 6 && $diff_hours >= 23 && $diff_minutes >= 55) {
+       elsif ($total_days >= 6 && $diff_hours >= 23 && $diff_minutes >= 55) {
                return "1 week";
        }
        # Ignore: between 2 days and 7 day - 15 minute window
-       elsif ($Total_days >= 2) {
+       elsif ($total_days >= 2) {
                return 0;
        }
        # 2 day notice: between 2 days and a 2 day -6 minute window
-       elsif ($Total_days >= 1 && $diff_hours >= 23 && $diff_minutes >= 55) {
+       elsif ($total_days >= 1 && $diff_hours >= 23 && $diff_minutes >= 55) {
                return "2 days";
        }
        # 1 day notice: between 1 days and a 1 day -6 minute window
-       elsif ($Total_days >= 0 && $diff_hours >= 23 && $diff_minutes >= 55) {
+       elsif ($total_days >= 0 && $diff_hours >= 23 && $diff_minutes >= 55) {
                return "24 hours";
        }
        
@@ -1512,7 +1512,7 @@ sub update_computer_lastcheck {
        notify($ERRORS{'WARNING'}, $log, "computer id is not defined") unless 
(defined($computer_id));
        return 0 unless (defined $computer_id);
 
-       unless (defined($datestring) ) {
+       unless (defined($datestring)) {
                $datestring = makedatestring;
        }
 
@@ -3149,7 +3149,7 @@ EOF
                        $request_info->{checkuser} = 0;
                        
$request_info->{reservation}{$reservation_id}{serverrequest}{ALLOW_USERS} = 
$request_info->{user}{unityid};
                }
-               elsif ($request_info->{DURATION} >= (60 * 60 * 24) ) {
+               elsif ($request_info->{DURATION} >= (60 * 60 * 24)) {
                        #notify($ERRORS{'DEBUG'}, 0, "request length > 24 
hours, disabling user checks");
                        $request_info->{checkuser} = 0;
                }
@@ -4895,7 +4895,7 @@ sub update_computer_imagename {
 
        #get computer infomation based on imagename
        my $imagerevision_info;
-       if ( $imagerevision_info = get_imagerevision_info($imagename)) {
+       if ($imagerevision_info = get_imagerevision_info($imagename)) {
                notify($ERRORS{'DEBUG'}, 0, "successfully retreived image info 
for $imagename");
        }
        else {
@@ -5724,7 +5724,7 @@ SET
 image.name = \'$new_image_name\',
 EOF
 
-       if (defined($new_image_pretty_name) ) {
+       if (defined($new_image_pretty_name)) {
                $update_statement .= <<EOF;
 image.prettyname = \'$new_image_pretty_name\',
 EOF
@@ -6527,11 +6527,11 @@ sub get_management_node_blockrequests {
        
        WHERE
        blockRequest.managementnodeid = $managementnode_id AND
-   blockRequest.status = 'accepted' AND
+       blockRequest.status = 'accepted' AND
        blockTimes.processed = '0' AND
-       (blockTimes.skip = '0' AND blockTimes.start < (NOW() + INTERVAL 360 
MINUTE )) OR
-   blockTimes.end < NOW() 
-   ";
+       (blockTimes.skip = '0' AND blockTimes.start < (NOW() + INTERVAL 360 
MINUTE)) OR
+       blockTimes.end < NOW() 
+       ";
 
        # Call the database select subroutine
        # This will return an array of one or more rows based on the select 
statement
@@ -6662,7 +6662,7 @@ sub get_computers_controlled_by_mn {
 
                        foreach my $id (keys %{ 
$info{manageable_resoucegroups}{$grp_id} } ) {
                                my $computer_group_id = 
$info{manageable_resoucegroups}{$grp_id}{$id}{groupid};
-                               if 
($info{"manageable_computer_grps"}{$id}{"members"} = 
get_computer_grp_members($computer_group_id) ) {
+                               if 
($info{"manageable_computer_grps"}{$id}{"members"} = 
get_computer_grp_members($computer_group_id)) {
                                        notify($ERRORS{'DEBUG'}, $LOGFILE, 
"retrieved computers from computer groupname= 
$info{manageable_resoucegroups}{$grp_id}{$id}{groupname}");
                                }
                                else {
@@ -6682,7 +6682,7 @@ sub get_computers_controlled_by_mn {
 
        foreach my $computergroup (keys %{ $info{manageable_computer_grps}}) {
                foreach my $computerid (keys %{ 
$info{manageable_computer_grps}{$computergroup}{members} }) {
-                       if ( !(exists $computer_list{$computerid}) ) {
+                       if (!(exists $computer_list{$computerid})) {
                                # add to return list
                                
$computer_list{$computerid}{"computer_id"}=$computerid;
                        }
@@ -9688,7 +9688,7 @@ sub string_to_ascii {
                        $ascii_value_string .= "\n" if $ascii_code == 10;
                        $previous_code = $ascii_code;
                }
-               elsif($ascii_code > 126) {
+               elsif ($ascii_code > 126) {
                        $ascii_value_string .= pack("C*", $ascii_code) . 
"<$ascii_code>";
                        $previous_code = -1;
                }
@@ -12173,9 +12173,9 @@ sub get_current_image_contents_no_data_s
 
 sub is_ip_assigned_query {
        
-       my ($IPaddress) = @_;
+       my ($ip_address) = @_;
 
-   if (!defined($IPaddress)) {
+   if (!defined($ip_address)) {
       notify($ERRORS{'WARNING'}, 0, "IPaddress  argument was not supplied");
       return;
    }   
@@ -12188,7 +12188,7 @@ computer.stateid AS computer_stateid,
 state.name AS state_name
 FROM computer, state
 WHERE
-computer.IPaddress = '$IPaddress' AND
+computer.IPaddress = '$ip_address' AND
 computer.stateid = state.id AND
 state.name != 'deleted' AND
 computer.vmhostid IS NOT NULL
@@ -12199,11 +12199,11 @@ EOF
 
    # Check to make sure 1 row was returned
    if (scalar @selected_rows == 0) {
-      notify($ERRORS{'OK'}, 0, "zero rows were returned from database select 
statement $IPaddress is available");
+      notify($ERRORS{'OK'}, 0, "zero rows were returned from database select 
statement $ip_address is available");
       return 0;
    }
        elsif (scalar @selected_rows >= 1) {
-      notify($ERRORS{'OK'}, 0, scalar @selected_rows . " rows were returned 
from database select statement: $IPaddress is assigned");
+      notify($ERRORS{'OK'}, 0, scalar @selected_rows . " rows were returned 
from database select statement: $ip_address is assigned");
       return 1;
    }
 
@@ -14532,7 +14532,7 @@ sub ip_address_to_network_address {
        }
        
        my $netmask_object = new Net::Netmask("$ip_address/$subnet_mask");
-       if(!$netmask_object) {
+       if (!$netmask_object) {
                notify($ERRORS{'WARNING'}, 0, "failed to create Net::Netmask 
object, IP address: $ip_address, subnet mask: $subnet_mask");
                return;
        }


Reply via email to