diff options
| author | Alexandre Derumier <aderumier@odiso.com> | 2019-11-26 10:00:25 +0100 |
|---|---|---|
| committer | Thomas Lamprecht <t.lamprecht@proxmox.com> | 2019-11-26 12:33:40 +0100 |
| commit | a2b32a94b8749585a90c57f4b3f262359a8b8cbd (patch) | |
| tree | b1e65075ea09ce61a378b421170842e444dc1523 /PVE/API2/Network/SDN | |
| parent | fa253735a4dd1023e5c110d804ac5a2cce2aaea6 (diff) | |
fix zones on_update_hook
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Diffstat (limited to 'PVE/API2/Network/SDN')
| -rw-r--r-- | PVE/API2/Network/SDN/Zones.pm | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/PVE/API2/Network/SDN/Zones.pm b/PVE/API2/Network/SDN/Zones.pm index 16c90cc..00380dc 100644 --- a/PVE/API2/Network/SDN/Zones.pm +++ b/PVE/API2/Network/SDN/Zones.pm @@ -142,17 +142,18 @@ __PACKAGE__->register_method ({ PVE::Network::SDN::Zones::lock_sdn_zones_config( sub { - my $cfg = PVE::Network::SDN::Zones::config(); + my $zone_cfg = PVE::Network::SDN::Zones::config(); + my $controller_cfg = PVE::Network::SDN::Controllers::config(); my $scfg = undef; - if ($scfg = PVE::Network::SDN::Zones::sdn_zones_config($cfg, $id, 1)) { + if ($scfg = PVE::Network::SDN::Zones::sdn_zones_config($zone_cfg, $id, 1)) { die "sdn zone object ID '$id' already defined\n"; } - $cfg->{ids}->{$id} = $opts; - $plugin->on_update_hook($id, $cfg); + $zone_cfg->{ids}->{$id} = $opts; + $plugin->on_update_hook($id, $zone_cfg, $controller_cfg); - PVE::Network::SDN::Zones::write_config($cfg); + PVE::Network::SDN::Zones::write_config($zone_cfg); }, "create sdn zone object failed"); @@ -201,11 +202,12 @@ __PACKAGE__->register_method ({ PVE::Network::SDN::Zones::lock_sdn_zones_config( sub { - my $cfg = PVE::Network::SDN::Zones::config(); + my $zone_cfg = PVE::Network::SDN::Zones::config(); + my $controller_cfg = PVE::Network::SDN::Controllers::config(); - PVE::SectionConfig::assert_if_modified($cfg, $digest); + PVE::SectionConfig::assert_if_modified($zone_cfg, $digest); - my $scfg = PVE::Network::SDN::Zones::sdn_zones_config($cfg, $id); + my $scfg = PVE::Network::SDN::Zones::sdn_zones_config($zone_cfg, $id); my $plugin = PVE::Network::SDN::Zones::Plugin->lookup($scfg->{type}); my $opts = $plugin->check_config($id, $param, 0, 1); @@ -214,9 +216,9 @@ __PACKAGE__->register_method ({ $scfg->{$k} = $opts->{$k}; } - $plugin->on_update_hook($id, $cfg); + $plugin->on_update_hook($id, $zone_cfg, $controller_cfg); - PVE::Network::SDN::Zones::write_config($cfg); + PVE::Network::SDN::Zones::write_config($zone_cfg); }, "update sdn zone object failed"); |
