vcl-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arku...@apache.org
Subject svn commit: r1799692 - in /vcl/trunk/managementnode/lib/VCL/Module: OS.pm OS/OSX.pm
Date Fri, 23 Jun 2017 18:14:23 GMT
Author: arkurth
Date: Fri Jun 23 18:14:23 2017
New Revision: 1799692

URL: http://svn.apache.org/viewvc?rev=1799692&view=rev
Log:
VCL-1055
Updated subroutines to not use "lc(shift)":
* OS.pm::get_mac_address
* OS.pm::get_ip_address
* OS.pm::get_default_gateway
* OS.pm::get_dns_servers
* OSX.pm::get_network_configuration

VCL-997
Added code to delete reservation_info.json file if it exists in OS.pm::pre_capture.

Modified:
    vcl/trunk/managementnode/lib/VCL/Module/OS.pm
    vcl/trunk/managementnode/lib/VCL/Module/OS/OSX.pm

Modified: vcl/trunk/managementnode/lib/VCL/Module/OS.pm
URL: http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/OS.pm?rev=1799692&r1=1799691&r2=1799692&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/OS.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/OS.pm Fri Jun 23 18:14:23 2017
@@ -134,6 +134,12 @@ sub pre_capture {
 	# Run custom pre_capture scripts
 	$self->run_stage_scripts('pre_capture');
 	
+	# Delete reservation_info.json
+	my $reservation_info_json_file_path = $self->get_reservation_info_json_file_path();
+	if ($reservation_info_json_file_path) {
+		$self->delete_file($reservation_info_json_file_path);
+	}
+	
 	notify($ERRORS{'OK'}, 0, "completed common image capture preparation tasks");
 	return 1;
 }
@@ -2306,7 +2312,8 @@ sub get_mac_address {
 	
 	# Check if a 'public' or 'private' network type argument was specified
 	# Assume 'public' if not specified
-	my $network_type = lc(shift()) || 'public';
+	my $network_type = shift || 'public';
+	$network_type = lc($network_type) if $network_type;
 	if ($network_type && $network_type !~ /(public|private)/i) {
 		notify($ERRORS{'WARNING'}, 0, "network type argument can only be 'public' or 'private'");
 		return;
@@ -2393,7 +2400,8 @@ sub get_ip_address {
 	
 	# Check if a 'public' or 'private' network type argument was specified
 	# Assume 'public' if not specified
-	my $network_type = lc(shift()) || 'public';
+	my $network_type = shift || 'public';
+	$network_type = lc($network_type) if $network_type;
 	if ($network_type && $network_type !~ /(public|private)/i) {
 		notify($ERRORS{'WARNING'}, 0, "network type argument can only be 'public' or 'private'");
 		return;
@@ -2638,7 +2646,8 @@ sub get_default_gateway {
 	
 	# Check if a 'public' or 'private' network type argument was specified
 	# Assume 'public' if not specified
-	my $network_type = lc(shift()) || 'public';
+	my $network_type = shift || 'public';
+	$network_type = lc($network_type) if $network_type;
 	if ($network_type && $network_type !~ /(public|private)/i) {
 		notify($ERRORS{'WARNING'}, 0, "network type argument can only be 'public' or 'private'");
 		return;
@@ -2725,7 +2734,8 @@ sub get_dns_servers {
 	
 	# Check if a 'public' or 'private' network type argument was specified
 	# Assume 'public' if not specified
-	my $network_type = lc(shift()) || 'public';
+	my $network_type = shift || 'public';
+	$network_type = lc($network_type) if $network_type;
 	if ($network_type && $network_type !~ /(public|private)/i) {
 		notify($ERRORS{'WARNING'}, 0, "network type argument can only be 'public' or 'private'");
 		return;

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=1799692&r1=1799691&r2=1799692&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/OS/OSX.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/OS/OSX.pm Fri Jun 23 18:14:23 2017
@@ -1567,7 +1567,8 @@ sub get_network_configuration {
 	}
 	
 	# Check if a 'public' or 'private' network type argument was specified
-	my $network_type = lc(shift());
+	my $network_type = shift;
+	$network_type = lc($network_type) if $network_type;
 	if ($network_type && $network_type !~ /(public|private)/i) {
 		notify($ERRORS{'WARNING'}, 0, "network type argument can only be 'public' or 'private'");
 		return;



Mime
View raw message