[pve-devel] [PATCH pve-container 2/2] api2 : use firewall helpers

Alexandre Derumier aderumier at odiso.com
Wed Jun 29 11:08:32 CEST 2022


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/API2/LXC.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index e909cb0..b15e327 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -11,7 +11,7 @@ use PVE::Cluster qw(cfs_read_file);
 use PVE::RRD;
 use PVE::DataCenterConfig;
 use PVE::AccessControl;
-use PVE::Firewall;
+use PVE::Firewall::Helpers qw(remove_vmfw_conf clone_vmfw_conf);
 use PVE::Storage;
 use PVE::RESTHandler;
 use PVE::RPCEnvironment;
@@ -761,7 +761,7 @@ __PACKAGE__->register_method({
 	    );
 
 	    PVE::AccessControl::remove_vm_access($vmid);
-	    PVE::Firewall::remove_vmfw_conf($vmid);
+	    remove_vmfw_conf($vmid);
 	    if ($param->{purge}) {
 	        print "purging CT $vmid from related configurations..\n";
 		PVE::ReplicationConfig::remove_vmid_jobs($vmid);
@@ -1462,7 +1462,7 @@ __PACKAGE__->register_method({
 	my $running;
 
 	PVE::LXC::Config->create_and_lock_config($newid, 0);
-	PVE::Firewall::clone_vmfw_conf($vmid, $newid);
+	clone_vmfw_conf($vmid, $newid);
 
 	my $lock_and_reload = sub {
 	    my ($vmid, $code) = @_;
@@ -1569,7 +1569,7 @@ __PACKAGE__->register_method({
 	    eval {
 		$lock_and_reload->($newid, sub {
 		    PVE::LXC::Config->destroy_config($newid);
-		    PVE::Firewall::remove_vmfw_conf($newid);
+		    remove_vmfw_conf($newid);
 		});
 	    };
 	    warn "Failed to remove target CT config - $@\n" if $@;
@@ -1661,7 +1661,7 @@ __PACKAGE__->register_method({
 		eval {
 		    $lock_and_reload->($newid, sub {
 			PVE::LXC::Config->destroy_config($newid);
-			PVE::Firewall::remove_vmfw_conf($newid);
+			remove_vmfw_conf($newid);
 		    });
 		};
 		warn "Failed to remove target CT config - $@\n" if $@;
-- 
2.30.2




More information about the pve-devel mailing list