From: Ken Dreyer Date: Thu, 12 Aug 2021 14:43:46 +0000 (-0400) Subject: workunits/rgw: remove lsb_release X-Git-Tag: v16.2.6~19^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=90e9307ab0a52da260bc1ebb50329cd8ff942eb9;p=ceph.git workunits/rgw: remove lsb_release The lsb_release utility brings in a lot of other dependencies. Remove it from the RGW workunit Perl scripts. Signed-off-by: Ken Dreyer (cherry picked from commit db66f6f35735d2aae2170af3520d222cf748ef9b) --- diff --git a/qa/workunits/rgw/s3_utilities.pm b/qa/workunits/rgw/s3_utilities.pm index 12e6af0ad65cb..ef33e78bcc45c 100644 --- a/qa/workunits/rgw/s3_utilities.pm +++ b/qa/workunits/rgw/s3_utilities.pm @@ -134,15 +134,28 @@ sub purge_data return 0; } +# Read PRETTY_NAME from /etc/os-release +sub os_pretty_name +{ + open(FH, '<', '/etc/os-release') or die $!; + while (my $line = ) { + chomp $line; + if ($line =~ /^\s*PRETTY_NAME=\"?([^"]*)\"?/) { + return $1; + } + } + close(FH); +} + + # Function to get the Ceph and distro info sub ceph_os_info { my $ceph_v = get_command_output ( "ceph -v" ); my @ceph_arr = split(" ",$ceph_v); $ceph_v = "Ceph Version: $ceph_arr[2]"; - my $os_distro = get_command_output ( "lsb_release -d" ); - my @os_arr = split(":",$os_distro); - $os_distro = "Linux Flavor:$os_arr[1]"; + my $os_distro = os_pretty_name() + $os_distro = "Linux Flavor:$os_distro"; return ($ceph_v, $os_distro); }