diff --git a/tools/Makefile.am b/tools/Makefile.am index 67570217..a497160c 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -13,7 +13,6 @@ dist_sbin_SCRIPTS = \ anvil-delete-server \ anvil-download-file \ anvil-file-details \ - anvil-jobs \ anvil-join-anvil \ anvil-maintenance-mode \ anvil-manage-files \ diff --git a/tools/anvil-change-password b/tools/anvil-change-password index 6054986d..833e623e 100755 --- a/tools/anvil-change-password +++ b/tools/anvil-change-password @@ -30,7 +30,6 @@ $< = $>; $( = $); my $anvil = Anvil::Tools->new(); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Make sure we're running as 'root' # $< == real UID, $> == effective UID @@ -41,6 +40,9 @@ if (($< != 0) && ($> != 0)) $anvil->nice_exit({exit_code => 1}); } +$anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); + # Connect $anvil->Database->connect(); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0132"}); diff --git a/tools/anvil-check-memory b/tools/anvil-check-memory index fd960f74..ecce13b0 100755 --- a/tools/anvil-check-memory +++ b/tools/anvil-check-memory @@ -30,7 +30,7 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) # Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete. $| = 1; -my $anvil = Anvil::Tools->new({log_level => 2, log_secure => 1}); +my $anvil = Anvil::Tools->new(); $anvil->data->{switches}{program} = ""; $anvil->Get->switches; diff --git a/tools/anvil-configure-host b/tools/anvil-configure-host index a1d1ab02..b05996d9 100755 --- a/tools/anvil-configure-host +++ b/tools/anvil-configure-host @@ -30,8 +30,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); # Read switches $anvil->Get->switches; diff --git a/tools/anvil-daemon b/tools/anvil-daemon index f7062757..e4910c17 100755 --- a/tools/anvil-daemon +++ b/tools/anvil-daemon @@ -876,7 +876,7 @@ sub run_jobs my $jobs_file = "{\"jobs\":[\n"; # Get a list of pending or incomplete jobs. - my $return = $anvil->Database->get_jobs({ended_within => 300}); + my $return = $anvil->Database->get_jobs({debug => 2, ended_within => 300}); my $count = @{$return}; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { 'return' => $return, @@ -897,7 +897,7 @@ sub run_jobs my $job_status = $hash_ref->{job_status}; my $started_seconds_ago = $job_picked_up_at ? (time - $job_picked_up_at) : 0; my $updated_seconds_ago = $job_updated ? (time - $job_updated) : 0; - $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { job_uuid => $job_uuid, job_command => $job_command, job_data => $job_data, @@ -1030,7 +1030,6 @@ sub run_jobs my $command = $job_command." --job-uuid ".$job_uuid; $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0210", variables => { command => $command }}); ($anvil->data->{jobs}{handles}{$job_uuid}, my $return_code) = $anvil->System->call({ - debug => 3, background => 1, stdout_file => "/tmp/anvil.job.".$job_uuid.".stdout", stderr_file => "/tmp/anvil.job.".$job_uuid.".stderr", diff --git a/tools/anvil-download-file b/tools/anvil-download-file index 87caf4d0..e56dd664 100755 --- a/tools/anvil-download-file +++ b/tools/anvil-download-file @@ -42,8 +42,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); $anvil->Database->connect; $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"}); diff --git a/tools/anvil-file-details b/tools/anvil-file-details index ec570a63..7e9f8c7b 100755 --- a/tools/anvil-file-details +++ b/tools/anvil-file-details @@ -28,8 +28,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); $anvil->data->{switches}{file} = ""; $anvil->data->{switches}{'with-md5sum'} = ""; diff --git a/tools/anvil-jobs b/tools/anvil-jobs deleted file mode 100755 index dec6e53e..00000000 --- a/tools/anvil-jobs +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/perl -# -# This program handles running jobs that might take some time to complete. -# -# Exit codes; -# 0 = Normal exit -# 1 = md5sum of this program changed. Exited to reload. -# -# TODO: -# - -use strict; -use warnings; -use Anvil::Tools; - -my $THIS_FILE = ($0 =~ /^.*\/(.*)$/)[0]; -my $running_directory = ($0 =~ /^(.*?)\/$THIS_FILE$/)[0]; -if (($running_directory =~ /^\./) && ($ENV{PWD})) -{ - $running_directory =~ s/^\./$ENV{PWD}/; -} - -# Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete. -$| = 1; - -my $anvil = Anvil::Tools->new(); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); - -# I should have been passed a 'job_uuid'. Read in the details. - - -$anvil->nice_exit({exit_code => 0}); - -############################################################################################################# -# Functions # -############################################################################################################# diff --git a/tools/anvil-join-anvil b/tools/anvil-join-anvil index c26b18a8..ebf40c12 100755 --- a/tools/anvil-join-anvil +++ b/tools/anvil-join-anvil @@ -33,13 +33,11 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is # passed directly, it will be used. Otherwise, the password will be read from the database. $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Database->connect(); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, key => "log_0132"}); diff --git a/tools/anvil-manage-files b/tools/anvil-manage-files index c38a964f..ceec7322 100755 --- a/tools/anvil-manage-files +++ b/tools/anvil-manage-files @@ -51,8 +51,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); $anvil->data->{switches}{'delete'} = ""; $anvil->data->{switches}{download} = ""; diff --git a/tools/anvil-manage-firewall b/tools/anvil-manage-firewall index bb8985de..27361ec2 100755 --- a/tools/anvil-manage-firewall +++ b/tools/anvil-manage-firewall @@ -41,8 +41,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 2}); # If the user has disabled auto-management of the firewall, exit. if (not $anvil->data->{sys}{manage}{firewall}) @@ -50,7 +48,7 @@ if (not $anvil->data->{sys}{manage}{firewall}) # Do nothing. $anvil->nice_exit({exit_code => 0}); } -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches $anvil->data->{switches}{'y'} = ""; diff --git a/tools/anvil-manage-keys b/tools/anvil-manage-keys index 480a4d44..e091a965 100755 --- a/tools/anvil-manage-keys +++ b/tools/anvil-manage-keys @@ -31,14 +31,12 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is # passed directly, it will be used. Otherwise, the password will be read from the database. $anvil->data->{switches}{'job-uuid'} = ""; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { 'switches::job-uuid' => $anvil->data->{switches}{'job-uuid'}, }}); diff --git a/tools/anvil-manage-power b/tools/anvil-manage-power index 9aa7b9a9..a37929df 100755 --- a/tools/anvil-manage-power +++ b/tools/anvil-manage-power @@ -33,7 +33,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches $anvil->data->{switches}{'poweroff'} = ""; @@ -45,6 +44,7 @@ $anvil->data->{switches}{'reboot-needed'} = ""; $anvil->data->{switches}{'job-uuid'} = ""; $anvil->data->{switches}{'no-delay'} = ""; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); if ($anvil->data->{switches}{'power-off'}) { diff --git a/tools/anvil-parse-fence-agents b/tools/anvil-parse-fence-agents index 13ac51ff..7a4affe6 100755 --- a/tools/anvil-parse-fence-agents +++ b/tools/anvil-parse-fence-agents @@ -24,12 +24,10 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 0}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->data->{switches}{refresh} = 0; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "switches::refresh" => $anvil->data->{switches}{refresh}, }}); diff --git a/tools/anvil-provision-server b/tools/anvil-provision-server index 716ff031..921524b4 100755 --- a/tools/anvil-provision-server +++ b/tools/anvil-provision-server @@ -29,9 +29,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is # passed directly, it will be used. Otherwise, the password will be read from the database. @@ -45,6 +42,7 @@ $anvil->data->{switches}{ram} = ""; $anvil->data->{switches}{'storage-group'} = ""; $anvil->data->{switches}{'storage-size'} = ""; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { 'switches::anvil-uuid' => $anvil->data->{switches}{'anvil-uuid'}, 'switches::os' => $anvil->data->{switches}{os}, diff --git a/tools/anvil-scan-network b/tools/anvil-scan-network index 2df3e123..ff924c29 100755 --- a/tools/anvil-scan-network +++ b/tools/anvil-scan-network @@ -30,7 +30,9 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); + +$anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); scan($anvil); diff --git a/tools/anvil-sync-shared b/tools/anvil-sync-shared index e5c83303..83a7f1b8 100755 --- a/tools/anvil-sync-shared +++ b/tools/anvil-sync-shared @@ -30,14 +30,11 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); - -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); # Read switches (target ([user@]host[:port]) and the file with the target's password. $anvil->data->{switches}{'job-uuid'} = ""; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); # Connect to the database(s). $anvil->Database->connect; diff --git a/tools/anvil-update-states b/tools/anvil-update-states index 5ebf3d56..cccc1709 100755 --- a/tools/anvil-update-states +++ b/tools/anvil-update-states @@ -18,10 +18,9 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 0}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); + $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # If there's no DB (or cached data isn't recorded to the database yet), this will store those records. $anvil->data->{cache}{new_file} = "# interface,timestamp,mac_address,speed,link_state,operational\n"; diff --git a/tools/anvil-update-system b/tools/anvil-update-system index 0e1f1a95..78d6ffb0 100755 --- a/tools/anvil-update-system +++ b/tools/anvil-update-system @@ -35,12 +35,11 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches $anvil->data->{switches}{'job-uuid'} = ""; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Log that we've started. $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); diff --git a/tools/scancore b/tools/scancore index e5b92515..0c162340 100755 --- a/tools/scancore +++ b/tools/scancore @@ -39,7 +39,7 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $running_directory =~ s/^\./$ENV{PWD}/; } -my $anvil = Anvil::Tools->new({log_level => 2, log_secure => 1}); +my $anvil = Anvil::Tools->new(); # Make sure we're running as 'root' # $< == real UID, $> == effective UID @@ -61,11 +61,11 @@ $anvil->data->{scancore} = { }; $anvil->Storage->read_config(); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches $anvil->data->{switches}{'run-once'} = ""; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); # Calculate my sum so that we can exit if it changes later. $anvil->Storage->record_md5sums(); diff --git a/tools/striker-get-peer-data b/tools/striker-get-peer-data index 042db3cb..0708ce7d 100755 --- a/tools/striker-get-peer-data +++ b/tools/striker-get-peer-data @@ -27,9 +27,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is # passed directly, it will be used. Otherwise, the password will be read from the database. @@ -37,6 +34,7 @@ $anvil->data->{switches}{target} = ""; $anvil->data->{switches}{'state-uuid'} = ""; $anvil->data->{switches}{password} = ""; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { 'switches::target' => $anvil->data->{switches}{target}, 'switches::state-uuid' => $anvil->data->{switches}{'state-uuid'}, diff --git a/tools/striker-initialize-host b/tools/striker-initialize-host index 1aa8ba6a..8f62c2bc 100755 --- a/tools/striker-initialize-host +++ b/tools/striker-initialize-host @@ -29,13 +29,11 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches (target ([user@]host[:port]) and the file with the target's password. $anvil->data->{switches}{'job-uuid'} = ""; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { 'switches::job-uuid' => $anvil->data->{switches}{'job-uuid'}, }}); diff --git a/tools/striker-manage-install-target b/tools/striker-manage-install-target index fd783153..ff0fa923 100755 --- a/tools/striker-manage-install-target +++ b/tools/striker-manage-install-target @@ -65,9 +65,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches $anvil->data->{switches}{check} = 0; @@ -79,6 +76,7 @@ $anvil->data->{switches}{'no-refresh'} = 0; $anvil->data->{switches}{refresh} = 0; $anvil->data->{switches}{status} = ""; $anvil->Get->switches(); +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { 'switches::check' => $anvil->data->{switches}{check}, 'switches::disable' => $anvil->data->{switches}{disable}, diff --git a/tools/striker-manage-peers b/tools/striker-manage-peers index ff25656b..a8fc17cd 100755 --- a/tools/striker-manage-peers +++ b/tools/striker-manage-peers @@ -39,7 +39,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches $anvil->data->{switches}{list} = ""; @@ -52,6 +51,7 @@ $anvil->data->{switches}{'port'} = 5432; $anvil->data->{switches}{'password-file'} = ""; $anvil->data->{switches}{'ping'} = 0; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Make sure we're running as 'root' # $< == real UID, $> == effective UID diff --git a/tools/striker-parse-os-list b/tools/striker-parse-os-list index fb9cef8c..de75b973 100755 --- a/tools/striker-parse-os-list +++ b/tools/striker-parse-os-list @@ -20,10 +20,10 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); # Read switches (target ([user@]host[:port]) and the file with the target's password. $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); my $words_file = $anvil->data->{path}{words}{'words.xml'}; my $language = $anvil->Words->language; diff --git a/tools/striker-parse-oui b/tools/striker-parse-oui index 83427d48..45dfe336 100755 --- a/tools/striker-parse-oui +++ b/tools/striker-parse-oui @@ -22,9 +22,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 0}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Database->connect; $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"}); @@ -38,6 +35,7 @@ if (not $anvil->data->{sys}{database}{connections}) $anvil->data->{switches}{'job-uuid'} = ""; $anvil->data->{switches}{force} = ""; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "switches::job-uuid" => $anvil->data->{switches}{'job-uuid'}, "switches::force" => $anvil->data->{switches}{force}, diff --git a/tools/striker-prep-database b/tools/striker-prep-database index d07596f1..d09cb275 100755 --- a/tools/striker-prep-database +++ b/tools/striker-prep-database @@ -27,9 +27,9 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 1}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); + +$anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); my $local_uuid = $anvil->Database->get_local_uuid(); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { local_uuid => $local_uuid }}); diff --git a/tools/striker-purge-host b/tools/striker-purge-host index 663ca5ab..c3d44bde 100755 --- a/tools/striker-purge-host +++ b/tools/striker-purge-host @@ -27,9 +27,10 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) # Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete. $| = 1; -my $anvil = Anvil::Tools->new({debug => 2}); -$anvil->Log->secure({set => 1}); -$anvil->Log->level({set => 2}); +my $anvil = Anvil::Tools->new(); + +$anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Database->connect({debug => 3}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0132"}); diff --git a/tools/striker-scan-network b/tools/striker-scan-network index 65eb2bed..41739957 100755 --- a/tools/striker-scan-network +++ b/tools/striker-scan-network @@ -30,9 +30,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); -$anvil->Log->level({set => 2}); -$anvil->Log->secure({set => 0}); -$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); # Make sure we're running as 'root' # $< == real UID, $> == effective UID @@ -57,12 +54,14 @@ $anvil->data->{switches}{network} = ""; $anvil->data->{switches}{'job-uuid'} = ""; $anvil->data->{switches}{force} = ""; $anvil->Get->switches; +$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "switches::network" => $anvil->data->{switches}{network}, "switches::job-uuid" => $anvil->data->{switches}{'job-uuid'}, "switches::force" => $anvil->data->{switches}{force}, }}); + update_progress($anvil, 0, "clear"); update_progress($anvil, 1, "log_0239,!!job-uuid!".$anvil->data->{switches}{'job-uuid'}."!!"); $anvil->data->{progress} = 1;