summaryrefslogtreecommitdiffstats
path: root/lib/network/connection.pm
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-01-24 09:57:13 +0000
committerOlivier Blin <dev@blino.org>2014-01-27 01:27:34 +0100
commit360f3b5937e1fb1ff173240ec5c3ee9f8e9f9491 (patch)
treed3b07ba39400d4bff52e37dea362ab2fdcefa1f3 /lib/network/connection.pm
parent8e18c8b9e3ae6db0687b240ccf7ecb242cded322 (diff)
downloaddrakx-net-360f3b5937e1fb1ff173240ec5c3ee9f8e9f9491.tar
drakx-net-360f3b5937e1fb1ff173240ec5c3ee9f8e9f9491.tar.gz
drakx-net-360f3b5937e1fb1ff173240ec5c3ee9f8e9f9491.tar.bz2
drakx-net-360f3b5937e1fb1ff173240ec5c3ee9f8e9f9491.tar.xz
drakx-net-360f3b5937e1fb1ff173240ec5c3ee9f8e9f9491.zip
ifcfg: Do not write the NM_CONTROLLED flag unless we know it's value.
If it's not read from the config, it will be read as undef, but written back as 'no'. This changes the behaviour where no setting means 'automatic' - i.e. if NM is installed, use it, otherwise don't. If the user wants to be specific, then they make the consious choice to tick the box in drakx-net. mga#6675 mga#9261
Diffstat (limited to 'lib/network/connection.pm')
-rw-r--r--lib/network/connection.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/network/connection.pm b/lib/network/connection.pm
index 5cab3ac..443c0e4 100644
--- a/lib/network/connection.pm
+++ b/lib/network/connection.pm
@@ -269,7 +269,8 @@ sub build_ifcfg_settings {
DEVICE => $self->get_interface,
ONBOOT => bool2yesno($self->{control}{onboot}),
ACCOUNTING => bool2yesno($self->{control}{accounting}),
- NM_CONTROLLED => bool2yesno($self->{control}{nm_controlled}),
+ # Only write NM_CONTROLLED if we absolutely know it's value
+ if_(defined $self->{control}{nm_controlled}, NM_CONTROLLED => bool2yesno($self->{control}{nm_controlled})),
USERCTL => bool2yesno($self->{control}{userctl}),
METRIC => $self->{control}{metric},
MTU => $self->{control}{mtu},