Commit 4a8674c9 authored by Dietmar Maurer's avatar Dietmar Maurer

return defaults if /etc/vz/vz.conf does not exists

I.e. when vzctl package is not installed.
parent 26cfda5b
...@@ -300,11 +300,15 @@ my $read_global_vz_config = sub { ...@@ -300,11 +300,15 @@ my $read_global_vz_config = sub {
my $res = { my $res = {
rootdir => '/var/lib/vz/root/$VEID', # note '$VEID' is a place holder rootdir => '/var/lib/vz/root/$VEID', # note '$VEID' is a place holder
privatedir => '/var/lib/vz/private/$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', 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) { if ($data =~ m/^\s*VE_PRIVATE=(.*)$/m) {
my $dir = $1; my $dir = $1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment