]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
return defaults if /etc/vz/vz.conf does not exists
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 3 Oct 2011 10:13:50 +0000 (12:13 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 3 Oct 2011 10:13:50 +0000 (12:13 +0200)
I.e. when vzctl package is not installed.

PVE/OpenVZ.pm

index d0a3019eb03c7aa7a6b72d907f565f846e3c7ff8..bd5bc76ade3290baff0e833c506055fb048790db 100644 (file)
@@ -300,11 +300,15 @@ my $read_global_vz_config  = sub {
     my $res = {
        rootdir => '/var/lib/vz/root/$VEID', # note '$VEID' is a place holder
        privatedir => '/var/lib/vz/private/$VEID', # note '$VEID' is a place holder
-       dumpdir => '/var/lib//vz/dump',
+       dumpdir => '/var/lib/vz/dump',
        lockdir => '/var/lib/vz/lock',
     };
     
-    my $data = PVE::Tools::file_get_contents("/etc/vz/vz.conf");
+    my $filename = "/etc/vz/vz.conf";
+
+    return $res if ! -f $filename;
+
+    my $data = PVE::Tools::file_get_contents($filename);
 
     if ($data =~ m/^\s*VE_PRIVATE=(.*)$/m) {
        my $dir = $1;