]> git.proxmox.com Git - pve-manager.git/commitdiff
perlcritic fixes
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Oct 2020 16:16:13 +0000 (18:16 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Oct 2020 16:18:35 +0000 (18:18 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/CLI/pve5to6.pm
PVE/Ceph/Tools.pm
PVE/Report.pm

index 7b1050e3857eb72d7fe6d0ea70ba1910ec88e550..19d19fa68488c9eed7db1d9530542cdb1f78aedf 100644 (file)
@@ -444,7 +444,7 @@ sub check_ceph {
     my $ceph_status = eval { PVE::API2::Ceph->status({ node => $nodename }); };
     my $osd_flags = eval { PVE::API2::Ceph->get_flags({ node => $nodename }); };
     my $noout_wanted = 1;
-    my $noout = $osd_flags =~ m/noout/ if $osd_flags;
+    my $noout = $osd_flags && $osd_flags =~ m/noout/;
 
     if (!$ceph_status || !$ceph_status->{health}) {
        log_fail("unable to determine Ceph status!");
index cc4238c9968d0f3ddb86941d31c27be8967555ec..12d309be2892389b45f3d839300a9c3af5b00b1b 100644 (file)
@@ -140,13 +140,11 @@ sub purge_all_ceph_services {
            my $service_exists = $type->{$name}->{service};
 
            if ($service_exists) {
-               eval {
-                   PVE::Ceph::Services::ceph_service_cmd('disable', "$service.$name");
-                   PVE::Ceph::Services::ceph_service_cmd('stop', "$service.$name");
-               };
-               my $err = $@ if $@;
-               warn "Could not disable/stop ceph-$service\@$name, error: $err\n"
-               if $err;
+               eval { PVE::Ceph::Services::ceph_service_cmd('disable', "$service.$name") };
+               warn "Could not disable ceph-$service\@$name, error: $@\n" if $@;
+
+               eval { PVE::Ceph::Services::ceph_service_cmd('stop', "$service.$name") };
+               warn "Could not stop ceph-$service\@$name, error: $@\n" if $@;
            }
        }
     }
index 529acb37390a0add7806453a4a8e0c0f4238dd50..a4a3d779ed731ba4b41d2b76943946b8641983dc 100644 (file)
@@ -75,8 +75,8 @@ my $init_report_cmds = sub {
     push @{$report_def->{volumes}}, 'zpool status', 'zpool list -v', 'zfs list' if cmd_exists('zfs');
 
     if (-e '/etc/ceph/ceph.conf') {
-       my $crbd = eval "`ceph osd pool ls | sed -e 's/^/echo /' | sed 'p;s/echo/rbd ls/g'`";
-       push @{$report_def->{volumes}}, 'ceph status', 'ceph osd status', 'ceph df', 'pveceph status', 'pveceph lspools', $crbd;
+       # TODO: add (now working) rdb ls over all pools? really needed?
+       push @{$report_def->{volumes}}, 'ceph status', 'ceph osd status', 'ceph df', 'pveceph status', 'pveceph pool ls';
     }
 
     push @{$report_def->{disk}}, 'multipath -ll', 'multipath -v3' if cmd_exists('multipath');