[pve-devel] r6138 - in pve-manager/pve2: . bin/init.d lib/PVE/API2
svn-commits at proxmox.com
svn-commits at proxmox.com
Wed Jun 22 08:47:12 CEST 2011
Author: dietmar
Date: 2011-06-22 08:47:12 +0200 (Wed, 22 Jun 2011)
New Revision: 6138
Modified:
pve-manager/pve2/ChangeLog
pve-manager/pve2/bin/init.d/pvenetcommit
pve-manager/pve2/lib/PVE/API2/Network.pm
pve-manager/pve2/lib/PVE/API2/Nodes.pm
Log:
fix init.d order and network edit
Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog 2011-06-21 13:28:18 UTC (rev 6137)
+++ pve-manager/pve2/ChangeLog 2011-06-22 06:47:12 UTC (rev 6138)
@@ -1,3 +1,7 @@
+2011-06-22 Proxmox Support Team <support at proxmox.com>
+
+ * bin/init.d/pvenetcommit: start before network
+
2011-06-21 Proxmox Support Team <support at proxmox.com>
* www/manager/*.js: never define data models twice (cause serious
Modified: pve-manager/pve2/bin/init.d/pvenetcommit
===================================================================
--- pve-manager/pve2/bin/init.d/pvenetcommit 2011-06-21 13:28:18 UTC (rev 6137)
+++ pve-manager/pve2/bin/init.d/pvenetcommit 2011-06-22 06:47:12 UTC (rev 6138)
@@ -2,7 +2,7 @@
### BEGIN INIT INFO
# Provides: pvenetcommit
-# Required-Start: checkroot $remote_fs
+# Required-Start: checkroot
# Required-Stop:
# Default-Start: S
# Default-Stop:
Modified: pve-manager/pve2/lib/PVE/API2/Network.pm
===================================================================
--- pve-manager/pve2/lib/PVE/API2/Network.pm 2011-06-21 13:28:18 UTC (rev 6137)
+++ pve-manager/pve2/lib/PVE/API2/Network.pm 2011-06-22 06:47:12 UTC (rev 6138)
@@ -109,11 +109,11 @@
my $check_duplicate_gateway = sub {
- my ($config) = @_;
+ my ($config, $newiface) = @_;
foreach my $iface (keys %$config) {
raise_param_exc({ gateway => "Default gateway already exists on interface '$iface'." })
- if ($config->{$iface}->{gateway})
+ if ($newiface ne $iface) && $config->{$iface}->{gateway};
}
};
@@ -148,7 +148,7 @@
raise_param_exc({ iface => "interface already exists" })
if $config->{$iface};
- &$check_duplicate_gateway($config)
+ &$check_duplicate_gateway($config, $iface)
if $param->{gateway};
$param->{method} = $param->{address} ? 'static' : 'manual';
@@ -204,7 +204,7 @@
delete $config->{$iface}->{$k};
}
- &$check_duplicate_gateway($config)
+ &$check_duplicate_gateway($config, $iface)
if $param->{gateway};
$param->{method} = $param->{address} ? 'static' : 'manual';
Modified: pve-manager/pve2/lib/PVE/API2/Nodes.pm
===================================================================
--- pve-manager/pve2/lib/PVE/API2/Nodes.pm 2011-06-21 13:28:18 UTC (rev 6137)
+++ pve-manager/pve2/lib/PVE/API2/Nodes.pm 2011-06-22 06:47:12 UTC (rev 6138)
@@ -232,6 +232,7 @@
path => '/nodes/{node}',
privs => [ 'Sys.PowerMgmt' ],
},
+ protected => 1,
description => "Reboot or shutdown a node.",
proxyto => 'node',
parameters => {
@@ -249,11 +250,13 @@
code => sub {
my ($param) = @_;
- if ($param->{command} eq 'reset') {
- system ("(sleep 2;shutdown -r now)&");
+ if ($param->{command} eq 'reboot') {
+ system ("(sleep 2;/sbin/reboot)&");
} elsif ($param->{command} eq 'shutdown') {
system ("(sleep 2;/sbin/poweroff)&");
}
+
+ return undef;
}});
More information about the pve-devel
mailing list