mirror of
git://git.proxmox.com/git/pve-network.git
synced 2025-04-30 19:27:11 +02:00
sdn: api: extract function that creates the sdn directory.
create_etc_interfaces_sdn_dir creates the /etc/pve/sdn directory. This allows mocking in tests to prevent system fs access in tests Signed-off-by: Stefan Lendl <s.lendl@proxmox.com> Reviewed-by: Max Carrara <m.carrara@proxmox.com> Tested-by: Max Carrara <m.carrara@proxmox.com> Reviewed-by: Stefan Hanreich <s.hanreich@proxmox.com> Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
This commit is contained in:
parent
40f020660d
commit
11d2ac73ff
|
@ -186,6 +186,10 @@ __PACKAGE__->register_method ({
|
||||||
return &$api_sdn_zones_config($cfg, $param->{zone});
|
return &$api_sdn_zones_config($cfg, $param->{zone});
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
sub create_etc_interfaces_sdn_dir {
|
||||||
|
mkdir("/etc/pve/sdn");
|
||||||
|
}
|
||||||
|
|
||||||
__PACKAGE__->register_method ({
|
__PACKAGE__->register_method ({
|
||||||
name => 'create',
|
name => 'create',
|
||||||
protected => 1,
|
protected => 1,
|
||||||
|
@ -207,7 +211,7 @@ __PACKAGE__->register_method ({
|
||||||
my $opts = $plugin->check_config($id, $param, 1, 1);
|
my $opts = $plugin->check_config($id, $param, 1, 1);
|
||||||
|
|
||||||
PVE::Cluster::check_cfs_quorum();
|
PVE::Cluster::check_cfs_quorum();
|
||||||
mkdir("/etc/pve/sdn");
|
create_etc_interfaces_sdn_dir();
|
||||||
|
|
||||||
PVE::Network::SDN::lock_sdn_config(sub {
|
PVE::Network::SDN::lock_sdn_config(sub {
|
||||||
my $zone_cfg = PVE::Network::SDN::Zones::config();
|
my $zone_cfg = PVE::Network::SDN::Zones::config();
|
||||||
|
|
Loading…
Reference in a new issue