]> git.proxmox.com Git - pve-network.git/commitdiff
create /etc/pve/sdn directory
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 28 Nov 2019 13:34:48 +0000 (14:34 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 29 Nov 2019 07:40:24 +0000 (08:40 +0100)
like for /etc/pve/ha, create it in api create

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/API2/Network/SDN/Controllers.pm
PVE/API2/Network/SDN/Vnets.pm
PVE/API2/Network/SDN/Zones.pm

index 03da2ad2d2f2fa8d8849a021f706273f0fbeb812..e16619c6862e430751807ca88dd37f8c0b7cd7a7 100644 (file)
@@ -132,6 +132,10 @@ __PACKAGE__->register_method ({
        my $plugin = PVE::Network::SDN::Controllers::Plugin->lookup($type);
        my $opts = $plugin->check_config($id, $param, 1, 1);
 
        my $plugin = PVE::Network::SDN::Controllers::Plugin->lookup($type);
        my $opts = $plugin->check_config($id, $param, 1, 1);
 
+        # create /etc/pve/sdn directory
+        PVE::Cluster::check_cfs_quorum();
+        mkdir("/etc/pve/sdn");
+
         PVE::Network::SDN::Controllers::lock_sdn_controllers_config(
            sub {
 
         PVE::Network::SDN::Controllers::lock_sdn_controllers_config(
            sub {
 
index d66cd1473ae7ecc3dcc099e789425a810cb71641..80fc3c6476f169a6030b671e95ece026921f4cf2 100644 (file)
@@ -112,6 +112,10 @@ __PACKAGE__->register_method ({
        my $type = extract_param($param, 'type');
        my $id = extract_param($param, 'vnet');
 
        my $type = extract_param($param, 'type');
        my $id = extract_param($param, 'vnet');
 
+        # create /etc/pve/sdn directory
+        PVE::Cluster::check_cfs_quorum();
+        mkdir("/etc/pve/sdn");
+
         PVE::Network::SDN::Vnets::lock_sdn_vnets_config(
            sub {
 
         PVE::Network::SDN::Vnets::lock_sdn_vnets_config(
            sub {
 
index d1492902425226fd2f166e2e754c4cbd3ab3d956..293880a51b57d4ff19fa5f4e6e7a6254788e2131 100644 (file)
@@ -139,6 +139,10 @@ __PACKAGE__->register_method ({
        my $plugin = PVE::Network::SDN::Zones::Plugin->lookup($type);
        my $opts = $plugin->check_config($id, $param, 1, 1);
 
        my $plugin = PVE::Network::SDN::Zones::Plugin->lookup($type);
        my $opts = $plugin->check_config($id, $param, 1, 1);
 
+        # create /etc/pve/sdn directory
+        PVE::Cluster::check_cfs_quorum();
+        mkdir("/etc/pve/sdn");
+
         PVE::Network::SDN::Zones::lock_sdn_zones_config(
            sub {
 
         PVE::Network::SDN::Zones::lock_sdn_zones_config(
            sub {