summaryrefslogtreecommitdiffstats
path: root/network.py
Commit message (Collapse)AuthorAgeFilesLines
* Let DNS lookups work from %post scripts (#468132)David Cantrell2008-10-271-1/+4
| | | | | Copy over /etc/resolv.conf to /mnt/sysimage/etc/resolv.conf so that %post scripts can succeed with DNS lookups.
* Do not use /.tmp for temporary files (#468720)David Cantrell2008-10-271-17/+13
| | | | | | network.py was still using this directory. Ooops. The bug also notes that /.dbus appears, but I cannot find anywhere in the anaconda code where we create /.dbus.
* Fix traceback in network.bringUp() (#468651)David Cantrell2008-10-261-4/+5
| | | | | | Let network.bringUp() work by calling network.write() with no parameters. bringUp() is used to bring up networking during installation.
* Tell NetworkManager not to touch network interfaces when / is a netfsHans de Goede2008-10-241-1/+9
| | | | | Tell NetworkManager not to touch anaconda configured interfaces when / is on a network based device.
* Fix a typo when using network --gateway (#468364).Chris Lumens2008-10-241-1/+1
|
* Do not write NM_CONTROLLED=yes to ifcfg files (#468028)David Cantrell2008-10-221-1/+0
| | | | | nm-system-settings only reads NM_CONTROLLED=no to know to ignore a device. By default, it assumes control of all devices.
* Handle unknown hosts in getDefaultHostname (#466775)David Cantrell2008-10-141-3/+8
| | | | If a host is unknown, socket.gethostbyaddr() gives us a 2-tuple.
* Try to look up the hostname by the IP address NM reports (#466775)David Cantrell2008-10-141-0/+36
| | | | | | NetworkManager stopped providing the Hostname property (thanks!), so get the IP address now and shove that through gethostbyaddr() and see if it produces anything useful.
* NM no longer provides the hostname as a property (#466775).Chris Lumens2008-10-141-34/+1
|
* Move persistent network udev rule to under /etc (#464844).Chris Lumens2008-10-141-4/+4
|
* Import shutil and fix typos in network.py.David Cantrell2008-10-101-1/+2
|
* Write new sysconfig data to a tmpdir first, then move in place.David Cantrell2008-10-101-22/+53
| | | | | Similar to the change to writeEnabledNetInfo(). Write new files somewhere else, then move them in place.
* Fix a traceback when there's no ksdevice given (#465638).Chris Lumens2008-10-061-0/+3
|
* Support ksdevice=link when booting from boot.iso.David Cantrell2008-10-021-1/+3
| | | | | If the user supplies ksdevice=link, make sure we automatically select the first network device found that has an active link.
* Automatically select NIC based on ksdevice= boot parameter.David Cantrell2008-10-021-5/+21
| | | | | | If you boot with boot.iso and pass ksdevice=DEVICE or ksdevice=MACADDR, use that to automatically select the NIC to use when we ask the user to bring up the network for installation.
* If there aren't any usable NICs, don't write out a config (#465127).Chris Lumens2008-10-011-0/+3
|
* Update FQDN patch to fix a couple tracebacks (#464191).Chris Lumens2008-09-301-5/+10
| | | | Patch from Thomas Woerner <twoerner AT redhat DOT com>.
* Allow users to enter a hostname or FQDN during installation (#464191)David Cantrell2008-09-291-22/+35
| | | | | | | | Set up /etc/hosts correctly if the user enters a hostname or an FQDN in the hostname screen in anaconda. This avoids name resolution problems when starting sendmail. Patch from Thomas Woerner <twoerner AT redhat DOT com>.
* Fix test for an empty hostname.Chris Lumens2008-09-291-1/+1
|
* Bring back isys.resetResolv() and fix NetworkManager polling in network.py.David Cantrell2008-09-241-1/+3
| | | | | | | | | Bring back the isys.resetResolv() function to kick glibc and make it reinitialize itself from /etc/resolv.conf again. We need to do this to account for NetworkManager writing out a new resolv.conf. In network.bringUp(), init i to 0 so we actually loop and poll NetworkManager's state.
* Poll 'State' property from NetworkManager in network.bringUp()David Cantrell2008-09-241-1/+21
| | | | | | | | After writing new networking settings, check the State property from NetworkManager to see if we are connected. Return True if we ever see state go to connected, False otherwise. Idea here is that the interface code can pop up an error if we get False from this function.
* Get rid of firstnetdevice in NetworkDavid Cantrell2008-09-241-12/+0
| | | | | | At least for now, I see no need for firstnetdevice in the same way before we started using NetworkManager. Might have to come back for specific cases, but I don't think it's necessary.
* Do not write /lib/udev.d rules if instPath is ''David Cantrell2008-09-241-22/+23
| | | | | | If instPath is empty, it means bringUp() has been called to kick out new network configuration files for use during installation. Do not try to write out udev.d files during installation.
* Fix problems with bringDeviceUp() calls (#463512)David Cantrell2008-09-241-5/+1
| | | | | | | Changed bringDeviceUp() in network.py to bringUp() since it really just writes out all new network configuration information and lets NetworkManager take over from there. Correct the calls to this method so we don't get tracebacks anymore.
* Pick up hostname if we have it, otherwise use localhost.localdomain (#461933)David Cantrell2008-09-181-2/+35
| | | | | | | | NetworkManager spawns dhclient, but provides nm-dhcp-client.action as the dhclient-script process, which means we never get the hostname set unless that program does it. NetworkManager retains all of the information from dhclient, so we need to ask it for the hostname and domain.
* Expand getDefaultHostname()David Cantrell2008-09-181-2/+2
| | | | | Try to find what the default hostname should be if it's also currently set to just 'localhost'.
* Add getDefaultHostname() to network.pyDavid Cantrell2008-09-181-0/+13
| | | | | | getDefaultHostname() returns a string to the caller (either the iw or textw interface that contains the default hostname to populate the UI with.
* NetworkManager fixes in network.pyDavid Cantrell2008-09-151-136/+63
| | | | | | | | | | | | | | | | | | | | | A number of changes: * Make gateway and nameserver settings be per device rather than global. * Allow for both GATEWAY and IPV6_DEFAULTGW per device. * Store nameservers as DNSx where x is an int starting at 1 and incrementing. For functions that need to write out nameserver information (kickstart files or resolv.conf), read the nameservers from the device settings hash table. * Add a bringDeviceUp() function which will call the write() method (with no instPath specified) to give us a new ifcfg-DEVICE file with the latest settings so nm-system-settings will see it and bring the device up. This function may (actually, probably will) need expansion to communicate/wait_for NetworkManager. The bringDeviceUp() function replaces the old isys dhcpNetDevice() and configNetDevice() functions.
* Avoid writing out NM_CONTROLLED more than once.David Cantrell2008-09-151-3/+3
| | | | | | | | | We always want to write: NM_CONTROLLED= to the ifcfg-DEVICE files regardless of the setting it has during installation.
* Write out final ifcfg-DEVICE files correctly.David Cantrell2008-09-151-25/+19
| | | | | Make sure we carry over the settings from the ifcfg-DEVICE files and current device states from NetworkManager.
* Use POSIX and LSB hostname length limit.David Cantrell2008-09-151-4/+2
| | | | | | | Going with 255 for now even though this seems to be loosely defined on Linux. POSIX specifies 255 as the max length, but Linux doesn't seem to have a maximum. But LSB likes the POSIX specification, so we'll stick with that.
* Consistent whitespace usage in network.pyDavid Cantrell2008-09-151-78/+78
|
* Add overrideDHCPhostname as an attribute.Chris Lumens2008-09-081-0/+1
|
* Fail gracefully if we can't talk to NetworkManager over DBus.David Cantrell2008-09-051-26/+31
| | | | | Wrap it all in try/except so we fail gracefully for now. This should make CD & DVD installs work.
* Remove references to isConfigured in network.pyDavid Cantrell2008-08-281-8/+3
| | | | | | Now using this variable anymore since we have NM. For now, just calling hasActiveNetDev() since that checks to see we are in NM_STATE_CONNECTED.
* Do not call has_key() on NetworkDevice, use isys.NM_*David Cantrell2008-08-271-15/+16
| | | | | | | | | The NetworkDevice class does not have has_key(), just call get() and check to see if it's empty. The NM_ and DBUS_ constants are currently in isys, so reference them there. Ideally NetworkManager would be offering a Python module that provides this sort of info.
* Add missing () to function definitions.David Cantrell2008-08-271-2/+2
| | | | | | It's: def anyUsingDHCP(): def anyUsingStatic():
* Gather network settings from NetworkManager and ifcfg files.David Cantrell2008-08-271-77/+113
| | | | | | Rewrite network.py to read network settings from NetworkManager and then ifcfg files. We still need these classes to support network configuration settings via kickstart.
* Use dbus in hasActiveNetDev() and _anyUsing()David Cantrell2008-08-251-36/+52
| | | | | | | Rewrote the hasActiveNetDev() and _anyUsing() function in network.py to talk to NetworkManager via dbus. Modified the calls in iw/network_gui.py and textw/network_text.py that use these functions.
* udev rules have changed location (#458570).Chris Lumens2008-08-111-4/+4
|
* 2008-06-04 Ján ONDREJ <ondrejj@salstar.sk> (via ondrejj@fedoraproject.org)Ján ONDREJ2008-06-041-1/+3
| | | | * po/sk.po: Typo fix.
* Write per-interface DNS info to ifcfg files (#443244)David Cantrell2008-04-281-0/+14
| | | | | | | | | | | NetworkManager needs to know DNS information on a per interface basis. Right now, we only prompt for global DNS information in anaconda. Write those settings to each ifcfg file on the target system. Will be updating the UI post-F-9 to better gather the network information since we are using NM now (or at least trying to get people to use it). Also write NM_CONTROLLED= to each ifcfg line.
* Clean up sanityCheckHostname() in network.pyDavid Cantrell2008-04-281-13/+12
| | | | | | | | Hostnames can start with digits. Removed inStrRange() since it seemed a little redundant. Left hostname length check at 64 characters, but put a comment reminding me that POSIX sets this limit to 255, so we should examine this in the future again.
* Preserve 'set the hostname' setting when going Next/Back (#443414)David Cantrell2008-04-251-1/+3
| | | | | | | | | | Better fix for #408921. Using network.overrideDHCPhostname to set the default behavior of requiring users to set a hostname. If the user changed that to 'use DHCP', clicked Next, then clicked Back, the network configuration screen would be back at manual for the hostname. Fixed that by honoring overrideDHCPhostname. Also took the opportunity to make overrideDHCPhostname a boolean since that's how we are using it.
* Write IPv6 values to /etc/sysconfig/... correctly (#433290)David Cantrell2008-04-181-18/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Handle cases where the default gateway is an IPv6 address, which has to be written as IPV6_DEFAULTGW rather than just GATEWAY. The UI still needs work as it is possible to have a default gateway for IPv4 and IPv6 concurrently, but we are only prompting for one address. This patch also removes the duplicate anyUsingDHCP() from iw/network_gui.py and uses the one in network.py. It also adds an anyUsingStatic() function. Some functions in network.py have been changed to return True/False rather than 1/0. The network configuration screen in anaconda (not stage 1, but in stage 2) will activate the gateway and DNS entry fields now if any interface is set to have any static configuration. Previously, it would only activate if all devices were set to manual configuration for everything. In addition, you can currently leave the fields blank, which works well for situations such as IPv4 being DHCP and IPv6 being static with no IPv6 gateway. The system will get a default gateway for IPv4 using DHCP in that case.
* Include KERNEL== in udev rules (#440568)David Woodhouse2008-04-151-2/+10
| | | | Include KERNEL== in the udev rules anaconda writes out to fix things on PS3
* In rescue mode, show interface configuration (#429953)David Cantrell2008-02-081-2/+2
| | | | | | | | On the first run of the chooseNetworkInterface() function in rescue mode, all network interfaces are shown as UNCONFIGURED regardless of their current configuration. This also affects text mode installations in the post-install configuration steps.
* Revert "Initial support for network --bootproto=ask (#401531)."Chris Lumens2008-01-301-1/+1
| | | | This reverts commit 062a1e5ebbf6dab03524a125c1ce34d3cea43fcb.
* If bootproto is dhcp, unset any static settings (#218489)David L. Cantrell Jr2008-01-171-0/+6
|
* Initial support for network --bootproto=ask (#401531).Chris Lumens2008-01-161-1/+1
| | | | | | | | This patch adds support for a new network bootproto. The point of this is to work around our basic assumption that no network line in the kickstart file means you get dhcp. Some environments may want the assumption that no network line means you get prompted for network configuration. That's what this patch adds.