[pve-devel] [PATCH manager 2/8] api/Ceph: cleanup module usage

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Nov 21 15:40:54 CET 2018


On Wed, Nov 21, 2018 at 11:42:37AM +0100, Thomas Lamprecht wrote:
> most of this was imported by just copying without veryfing if all is
> actually required. Some lost it's purpose as we re-used more from our
> existing module code base (e.g., pve-common) but wasn't actually
> removed.
> 
> As this file includes two perl modules you need to take a bit caution
> when looking at this, as some things are used in one module but not
> the other - simple grep'ing at this may give false positives.
> 
> Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> ---
>  PVE/API2/Ceph.pm | 17 +++--------------
>  1 file changed, 3 insertions(+), 14 deletions(-)
> 
> diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
> index 23cd9ca8..cd62c040 100644
> --- a/PVE/API2/Ceph.pm
> +++ b/PVE/API2/Ceph.pm
> @@ -532,33 +532,22 @@ package PVE::API2::Ceph;
>  
>  use strict;
>  use warnings;
> -use File::Basename;
> +
>  use File::Path;
> -use POSIX qw (LONG_MAX);
> -use Cwd qw(abs_path);
> -use IO::Dir;
>  use UUID;
> -use Net::IP;
>  
> -use PVE::SafeSyslog;
> -use PVE::Tools qw(extract_param run_command file_get_contents file_read_firstline dir_glob_regex dir_glob_foreach);
> -use PVE::Exception qw(raise raise_param_exc);
> -use PVE::INotify;
> -use PVE::Cluster qw(cfs_lock_file cfs_read_file cfs_write_file);
> -use PVE::AccessControl;
> +use PVE::Tools qw(run_command file_get_contents);
> +use PVE::Cluster;
>  use PVE::Storage;
>  use PVE::RESTHandler;
>  use PVE::RPCEnvironment;
>  use PVE::JSONSchema qw(get_standard_option);
> -use JSON;
>  use PVE::RADOS;
>  use PVE::CephTools;
>  use PVE::Network;

it's (still - not caused by this patch) missing PVE::API2::Storage
($add_storage calls it).

like for #1, it might be nice to sort these lists since we are already
touching them.

>  
>  use base qw(PVE::RESTHandler);
>  
> -use Data::Dumper; # fixme: remove
> -
>  my $pve_osd_default_journal_size = 1024*5;
>  
>  __PACKAGE__->register_method ({
> -- 
> 2.19.1
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list