From 3616a4de0daf323d6624af996a26904b44417c31 Mon Sep 17 00:00:00 2001 From: Travis Harrison Date: Fri, 15 Jul 2016 11:29:55 -0500 Subject: [PATCH 1/4] add vm_user option --- ManageBulkInstances.pm | 3 ++- vmAWE.pl | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ManageBulkInstances.pm b/ManageBulkInstances.pm index 993b519..d366554 100644 --- a/ManageBulkInstances.pm +++ b/ManageBulkInstances.pm @@ -55,7 +55,7 @@ my $os_auth_url = $ENV{'OS_AUTH_URL'}; my $ssh_options = "-o StrictHostKeyChecking=no"; # StrictHostKeyChecking=no because I am too lazy to check for the question. -my $vm_user = 'ubuntu'; +our $vm_user = 'ubuntu'; my @hobbitlist = ("Frodo","Samwise","Meriadoc","Peregrin","Gandalf","Aragorn","Legolas","Gimli","Denethor","Boromir","Faramir","Galadriel","Celeborn","Elrond","Bilbo","Theoden","Eomer","Eowyn","Treebeard"); @@ -125,6 +125,7 @@ our $options_specify = [ "Specify existing VMs for actions and deletion", our $options_other_opts = ["Other options", "noownercheck" => "disables owner check", undef, + "vm_user" => "username for vm login and home dir", undef, "debug" => "debug info", undef ]; diff --git a/vmAWE.pl b/vmAWE.pl index cc365ef..4266738 100755 --- a/vmAWE.pl +++ b/vmAWE.pl @@ -112,6 +112,11 @@ sub thread_function { $arg_hash{"username"} = "ubuntu"; } + unless (defined $arg_hash{"vm_user"}) { + $arg_hash{"vm_user"} = $vm_user; + } + $vm_user = $arg_hash{"vm_user"}; + my $remote = $arg_hash{"username"}."\@$ip"; my $remoteDataDir = "/home/".$arg_hash{"username"}."/data/"; From 1e8d02a6e69bc5b138302e8ae2a1111b5da1ecdf Mon Sep 17 00:00:00 2001 From: Travis Harrison Date: Fri, 15 Jul 2016 11:31:15 -0500 Subject: [PATCH 2/4] add vm_user option --- vmAWE.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vmAWE.pl b/vmAWE.pl index 4266738..e0c727e 100755 --- a/vmAWE.pl +++ b/vmAWE.pl @@ -113,9 +113,9 @@ sub thread_function { } unless (defined $arg_hash{"vm_user"}) { - $arg_hash{"vm_user"} = $vm_user; + $arg_hash{"vm_user"} = $ManageBulkInstances::vm_user; } - $vm_user = $arg_hash{"vm_user"}; + $ManageBulkInstances::vm_user = $arg_hash{"vm_user"}; my $remote = $arg_hash{"username"}."\@$ip"; my $remoteDataDir = "/home/".$arg_hash{"username"}."/data/"; From 619b16b2dbca524b3476c37f48f786a2f8a631cc Mon Sep 17 00:00:00 2001 From: Travis Harrison Date: Fri, 15 Jul 2016 11:34:06 -0500 Subject: [PATCH 3/4] add vm_user option --- ManageBulkInstances.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ManageBulkInstances.pm b/ManageBulkInstances.pm index d366554..b912d21 100644 --- a/ManageBulkInstances.pm +++ b/ManageBulkInstances.pm @@ -125,7 +125,7 @@ our $options_specify = [ "Specify existing VMs for actions and deletion", our $options_other_opts = ["Other options", "noownercheck" => "disables owner check", undef, - "vm_user" => "username for vm login and home dir", undef, + "vm_user=s" => "username for vm login and home dir", undef, "debug" => "debug info", undef ]; From 191843100bd1d6d208ddf5d93bc2b68039fb1b2c Mon Sep 17 00:00:00 2001 From: Travis Harrison Date: Mon, 18 Jul 2016 15:16:28 -0500 Subject: [PATCH 4/4] add vm_user option --- vmAWE.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vmAWE.pl b/vmAWE.pl index e0c727e..3b016b2 100755 --- a/vmAWE.pl +++ b/vmAWE.pl @@ -87,6 +87,11 @@ # get values from config file ManageBulkInstances::read_config_file(\%arg_hash, "default"); +unless (defined $arg_hash{"vm_user"}) { + $arg_hash{"vm_user"} = $ManageBulkInstances::vm_user; +} +$ManageBulkInstances::vm_user = $arg_hash{"vm_user"}; + # get values from IP file if (defined $arg_hash{"ipfile"}) { ManageBulkInstances::read_config_file(\%arg_hash, $arg_hash{"ipfile"}); @@ -112,11 +117,6 @@ sub thread_function { $arg_hash{"username"} = "ubuntu"; } - unless (defined $arg_hash{"vm_user"}) { - $arg_hash{"vm_user"} = $ManageBulkInstances::vm_user; - } - $ManageBulkInstances::vm_user = $arg_hash{"vm_user"}; - my $remote = $arg_hash{"username"}."\@$ip"; my $remoteDataDir = "/home/".$arg_hash{"username"}."/data/";