]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
workunits/rgw: remove lsb_release
authorKen Dreyer <kdreyer@redhat.com>
Thu, 12 Aug 2021 14:43:46 +0000 (10:43 -0400)
committerKen Dreyer <kdreyer@redhat.com>
Tue, 31 Aug 2021 21:19:18 +0000 (17:19 -0400)
The lsb_release utility brings in a lot of other dependencies. Remove
it from the RGW workunit Perl scripts.

Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
(cherry picked from commit db66f6f35735d2aae2170af3520d222cf748ef9b)

qa/workunits/rgw/s3_utilities.pm

index 12e6af0ad65cb8ce8309aa87e72b2760967db4a5..ef33e78bcc45c01cf5069f29daeebef6a9fd571a 100644 (file)
@@ -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 = <FH>) {
+        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);
 }