summaryrefslogtreecommitdiffstats
path: root/network.py
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* Ensure there's an active deviceJeremy Katz2007-12-191-1/+2
| | | | | | Don't build new NetworkDevice objects when checking available() unless we actually have a new device. Otherwise, we end up with no devices active on the netconfig screen
* Clean up typos and other things for GPLv2+ changes.David Cantrell2007-12-171-4/+4
| | | | | | | Shorten 'Red Hat Author(s)' to just 'Author(s)'. Perhaps eventually we'll get an AUTHORS file and will just remove author names from the individual files. Also fixed a type in scripts/dumphdrlist.py where Author was listed twice.
* Common GPLv2+ boilerplate on toplevel python source files.David Cantrell2007-12-171-10/+16
| | | | | | Updated all *.py files to have a uniform GPL boilerplate. Expanded copyright year ranges and listed authors (if they were in the comment section) under the Red Hat Author(s) section.
* Use HAL to probe for available network devices.Bill Nottingham2007-12-071-50/+11
|
* 2007-10-28 Jeremy Katz <katzj@redhat.com>Jeremy Katz2007-10-281-0/+2
| | | | | * network.py (Network._sysfsDeviceIsUsable): Don't show bridge devices (#354561)
* * network.py (Network.write): Set IPV6INIT for all cases (#328931).f8-baseDavid Cantrell2007-10-231-2/+7
|
* * network.py (Network.write): Write out the IPV6* variables to theDavid Cantrell2007-10-231-0/+15
| | | | | ifcfg files correctly, avoid IPV6ADDR=dhcp and other invalid settings (#328931).
* Filter available network devices by checking their type in sysfs (#338461).Chris Lumens2007-10-191-1/+11
|
* * network.py: add ATTR{type}=="1" to rule to avoid matching wmaster*Bill Nottingham2007-10-181-1/+1
|
* 2007-10-11 Bill Nottingham <notting@redhat.com>Bill Nottingham2007-10-111-0/+25
| | | | | * network.py: write persistent udev network device name rules (#264901) * packages.py: restore SELinux context on rules file
* 2007-10-11 Jeremy Katz <katzj@redhat.com>Jeremy Katz2007-10-111-2/+2
| | | | * network.py (Network.write): Fix spaces between host names
* 2007-10-10 Jeremy Katz <katzj@redhat.com>Jeremy Katz2007-10-101-1/+2
| | | | | * network.py (NetworkDevice.__str__): Don't traceback with unconfigured nics (#325071)
* * network.py (Network.write): Add the short hostname to theDavid Cantrell2007-09-041-5/+9
| | | | | | 127.0.0.1 entry in /etc/hosts in addition to a real hostname line if we can do it. Helps laptop users boot more quickly when the network is disconnected (#253979).
* (merges from f7-branch)Jeremy Katz2007-05-301-0/+8
| | | | | | | | | | | | | | | | | | | | | 2007-05-30 Jeremy Katz <katzj@aglarond.local> * isys/isys.py (_stopRaid): Fix raidstop. I have no clue how things were working here... * isys/isys.py (_getRaidInfo): raise ValueError when we don't find a valid raid superblock (#151653). * upgrade.py: More blacklist * isys/isys.h (EARLY_SWAP_RAM): Let's bump RAM needs a little (#232862) * iw/netconfig_dialog.py (NetworkConfigurator._handleIPError): Add a frame so things look right (NetworkConfigurator._ok): Set useipv4 to true, call netconfig methods with the right args (#240804) * network.py (hasActiveNetDev): Ensure we have an IP as otherwise, the network device isn't really all that active.
* * network.py: Update calls to configNetDevice() and dhcpNetDevice() inDavid Cantrell2007-05-071-5/+2
| | | | isys to match new parameter list.
* * network.py (Network.write): Do not write out a disable-ipv6 fileDavid Cantrell2007-04-261-16/+0
| | | | | | | in /etc/modprobe.d if the user has disabled IPv6 during install (#237642). * packages.py (setFileCons): Remove /etc/modprobe.d from the list (#237642).
* * network.py (Network.write): Only write out one disable-ipv6 file toDavid Cantrell2007-04-241-10/+5
| | | | the /etc/modprobe.d directory as the setting is global (#237642).
* * isys/nl.c (netlink_init_interfaces_list): Fix RTM_GETLINK messageDavid Cantrell2007-04-171-20/+28
| | | | | | | | reassembly. Also, make sure we read the entire interface name rather than just the first four characters. Use BUFSZ macro throughout code. Fixes numerous problems, including the missing HWADDR line (#234764) * isys/nl.h: Define BUFSZ. * isys/isys.c: Looks like I fixed some whitespace.
* * network.py (Network.write): Do not write out NETWORKING_IPV6 lineDavid Cantrell2007-04-171-34/+40
| | | | | | | to /etc/sysconfig/network anymore, initscripts does not use it. Instead, write a file to /etc/modprobe.d containing 'install ipv6 /bin/true' in the cases where users want the IPv6 stack completely disabled.
* * gui.py (releaseNotesButtonClicked): Spaces vs. tabs, tonight at 11.David Cantrell2007-03-271-9/+2
| | | | | | | | | * network.py (hasActiveDev): Use isys.getLinkStatus() rather than isys.getIPAddress() (#232512). * isys/isys.c (doGetIPAddress): Do not clear netlink cache. * isys/nl.c: Netlink cache searching cleanups.
* * network.py: When gathering network device description from kudzu,David Cantrell2007-03-261-1/+1
| | | | only probe for devices with modules currently loaded (#233507).
* Don't write out an extraneous "yes" (#227250).Chris Lumens2007-02-231-3/+3
|
* 2007-01-10 Jeremy Katz <katzj@redhat.com>Jeremy Katz2007-01-101-2/+8
| | | | | | * network.py (NetworkDevice.__str__): Don't try to write out USEIPV4/USEIPV6 on a per-device basis (Network.write): Fix NETWORK_IPV6 for current code.
* * network.py: Set NETWORKING_IPV6 in /etc/sysconfig/network toDavid Cantrell2007-01-101-3/+3
| | | | | yes or no depending on whether the user enabled or disabled IPv6 during installation (#222147).