]> git.proxmox.com Git - pve-manager.git/commitdiff
pve6to7: use file_get_contents
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 18 Jun 2021 08:57:10 +0000 (10:57 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 18 Jun 2021 08:59:52 +0000 (10:59 +0200)
instead of File::Slurp

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
PVE/CLI/pve6to7.pm

index 412fb30f99ac806f4b12b7750e029047fd48a9c4..fc779e4f308e6f2d32a5099e134016272e05d845 100644 (file)
@@ -21,7 +21,6 @@ use PVE::Tools qw(run_command split_list);
 use PVE::QemuServer;
 use PVE::VZDump::Common;
 
-use File::Slurp;
 use Term::ANSIColor;
 
 use PVE::CLIHandler;
@@ -606,7 +605,11 @@ sub check_cifs_credential_location {
 sub check_custom_pool_roles {
     log_info("Checking custom roles for pool permissions..");
 
-    my $raw = read_file('/etc/pve/user.cfg');
+    my $raw = eval { PVE::Tools::file_get_contents('/etc/pve/user.cfg'); };
+    if ($@) {
+       log_fail("Failed to read '/etc/pve/user.cfg' - $@");
+       return;
+    }
 
     my $roles = {};
     while ($raw =~ /^\s*(.+?)\s*$/gm) {