From e14b1fc93e4a7d8bb59ad369b1fcb11f4f0bfc12 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Fri, 10 Jun 2022 14:59:08 -0400 Subject: [PATCH] fix(tools): use absolute paths in anvil-get-server-screenshot --- Anvil/Tools.pm | 6 ++++++ tools/anvil-get-server-screenshot | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Anvil/Tools.pm b/Anvil/Tools.pm index af33f164..85543740 100644 --- a/Anvil/Tools.pm +++ b/Anvil/Tools.pm @@ -1083,6 +1083,9 @@ sub _set_paths 'redhat-release' => "/etc/redhat-release", fences_unified_metadata => "/var/www/html/fences_unified_metadata.xml", }, + devices => { + stdout => "/dev/stdout", + }, directories => { alert_emails => "/var/spool/anvil", anvil => "/etc/anvil", @@ -1148,6 +1151,7 @@ sub _set_paths 'anvil-update-states' => "/usr/sbin/anvil-update-states", 'anvil-update-system' => "/usr/sbin/anvil-update-system", augtool => "/usr/bin/augtool", + base64 => "/usr/bin/base64", blockdev => "/usr/sbin/blockdev", bridge => "/usr/sbin/bridge", bzip2 => "/usr/bin/bzip2", @@ -1224,6 +1228,8 @@ sub _set_paths ocf_alteeve => "/usr/lib/ocf/resource.d/alteeve/server", openssl => "/usr/bin/openssl", 'osinfo-query' => "/usr/bin/osinfo-query", + pamscale => "/usr/bin/pamscale", + pamtopng => "/usr/bin/pamtopng", passwd => "/usr/bin/passwd", pcs => "/usr/sbin/pcs", perccli64 => "/opt/MegaRAID/perccli/perccli64", diff --git a/tools/anvil-get-server-screenshot b/tools/anvil-get-server-screenshot index 0ab356c2..8c956d7e 100755 --- a/tools/anvil-get-server-screenshot +++ b/tools/anvil-get-server-screenshot @@ -51,16 +51,16 @@ sub get_server_screenshot my $server_uuid = $parameters->{server_uuid}; my $resize_args = defined $parameters->{resize_args} ? $parameters->{resize_args} : ''; - my $shell_call = "virsh --quiet screenshot --domain ".$server_uuid." --file /dev/stdout"; + my $shell_call = $anvil->data->{path}{exe}{virsh}" --quiet screenshot --domain ".$server_uuid." --file ".$anvil->data->{path}{devices}{stdout}; if ($resize_args =~ /^\d+x\d+$/) { my ($resize_x, $resize_y) = split(/x/ , $resize_args); - $shell_call .= " | pamscale -quiet -xyfit ".$resize_x." ".$resize_y; + $shell_call .= " | ".$anvil->data->{path}{exe}{pamscale}." -quiet -xyfit ".$resize_x." ".$resize_y; } - $shell_call .= " | pamtopng -quiet | base64 --wrap 0"; + $shell_call .= " | ".$anvil->data->{path}{exe}{pamtopng}." -quiet | ".$anvil->data->{path}{exe}{base64}." --wrap 0"; my ($shell_output, $shell_return_code) = system_call({ shell_call => $shell_call });