summaryrefslogtreecommitdiffstats
path: root/network.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-12-01 03:51:16 +0000
committerJeremy Katz <katzj@redhat.com>2004-12-01 03:51:16 +0000
commit8ba99971a9679d7ade18b3c87882f279706bbfd5 (patch)
treeae1f09f4c5d591dd9339b49fe3977a92fcc29cf3 /network.py
parentb6020127209f84bbb72125f2cc75f683885608ff (diff)
downloadanaconda-8ba99971a9679d7ade18b3c87882f279706bbfd5.tar.gz
anaconda-8ba99971a9679d7ade18b3c87882f279706bbfd5.tar.xz
anaconda-8ba99971a9679d7ade18b3c87882f279706bbfd5.zip
2004-11-30 Jeremy Katz <katzj@redhat.com>
* network.py (Network.write): Write WEPKEY in /etc/sysconfig/network-scripts/keys-$DEVNAME with mode 0600 (#140645)
Diffstat (limited to 'network.py')
-rw-r--r--network.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/network.py b/network.py
index e81e7d81b..5f3fd976d 100644
--- a/network.py
+++ b/network.py
@@ -102,6 +102,8 @@ class NetworkDevice(SimpleConfigFile):
keys.remove("DEVICE")
if "DESC" in keys:
keys.remove("DESC")
+ if "KEY" in keys:
+ keys.remove("KEY")
# Don't let onboot be turned on unless we have config information
# to go along with it
@@ -395,9 +397,17 @@ class Network:
f.write("DHCP_HOSTNAME=%s\n" %(self.hostname,))
if dev.get('dhcpclass'):
f.write("DHCP_CLASSID=%s\n" % dev.get('dhcpclass'))
-
+
f.close()
+ if dev.get("key"):
+ fn = "%s/etc/sysconfig/network-scripts/keys-%s" % (instPath,
+ device)
+ f = open(fn, "w")
+ os.chmod(fn, 0600)
+ f.write("KEY=%s\n" % dev.get('key'))
+ f.close()
+
# /etc/sysconfig/network
f = open(instPath + "/etc/sysconfig/network", "w")