always pass cluster_conf to load_vmfw_conf
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 28 May 2014 04:47:05 +0000 (06:47 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 28 May 2014 04:47:05 +0000 (06:47 +0200)
src/PVE/API2/Firewall/Aliases.pm
src/PVE/API2/Firewall/VM.pm

index 1a637de..e25ae9c 100644 (file)
@@ -324,7 +324,8 @@ __PACKAGE__->additional_parameters({
 sub load_config {
     my ($class, $param) = @_;
 
-    my $fw_conf = PVE::Firewall::load_vmfw_conf('vm', $param->{vmid});
+    my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
+    my $fw_conf = PVE::Firewall::load_vmfw_conf($cluster_conf, 'vm', $param->{vmid});
     my $aliases = $fw_conf->{aliases};
 
     return ($fw_conf, $aliases);
@@ -355,7 +356,8 @@ __PACKAGE__->additional_parameters({
 sub load_config {
     my ($class, $param) = @_;
 
-    my $fw_conf = PVE::Firewall::load_vmfw_conf('ct', $param->{vmid});
+    my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
+    my $fw_conf = PVE::Firewall::load_vmfw_conf($cluster_conf, 'ct', $param->{vmid});
     my $aliases = $fw_conf->{aliases};
 
     return ($fw_conf, $aliases);
index 040f23e..732f6bf 100644 (file)
@@ -115,7 +115,8 @@ sub register_handlers {
        code => sub {
            my ($param) = @_;
 
-           my $vmfw_conf = PVE::Firewall::load_vmfw_conf($rule_env, $param->{vmid});
+           my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
+           my $vmfw_conf = PVE::Firewall::load_vmfw_conf($cluster_conf, $rule_env, $param->{vmid});
 
            return PVE::Firewall::copy_opject_with_digest($vmfw_conf->{options});
        }});
@@ -144,7 +145,9 @@ sub register_handlers {
        code => sub {
            my ($param) = @_;
 
-           my $vmfw_conf = PVE::Firewall::load_vmfw_conf($rule_env, $param->{vmid});
+
+           my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
+           my $vmfw_conf = PVE::Firewall::load_vmfw_conf($cluster_conf, $rule_env, $param->{vmid});
 
            my (undef, $digest) = PVE::Firewall::copy_opject_with_digest($vmfw_conf->{options});
            PVE::Tools::assert_if_modified($digest, $param->{digest});