summaryrefslogtreecommitdiffstats
path: root/network.py
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Write ARP=no to ifcfg file when VSWITCH=1 is set on s390x (#561926)."David Cantrell2010-02-111-10/+3
| | | | | | | | | This reverts commit 3b90bea90eb3c65f34e358babcb866b1514a4994. ARP=no did not actually fix the problem with VSWITCH=1, nor did ARP=yes. The problem was found to be in the /lib/udev/ccw_init file, which is part of initscripts. The ifup script is not able to handle the asynchronous bring up of s390x network devices.
* Merge branch 'no-instdata'Chris Lumens2010-02-081-3/+3
|\
| * Move storage into the Anaconda class.Chris Lumens2010-02-041-2/+2
| |
| * Move network to the Anaconda object.Chris Lumens2010-02-041-1/+1
| |
* | Write ARP=no to ifcfg file when VSWITCH=1 is set on s390x (#561926).David Cantrell2010-02-051-3/+10
|/ | | | | | | | | | | When using LAYER2=1 VSWITCH=1 in your CMS conf file on s390x, the ifcfg file written by anaconda will result in a non-working network connection on reboot after installation. When LAYER2=1, we already prevent writing of the HWADDR to the ifcfg file, but when VSWITCH=1, we need to write ARP=no to the ifcfg file as well. Make sure to carry over VSWITCH in linuxrc.s390, but also make sure we don't write it to the final ifcfg file on the target system.
* pylint error fixes round 2Hans de Goede2010-01-141-1/+1
| | | | | | | | | | | - Remove unnecessary semi colons in various places - textw/upgrade_text.py: add a few missing imports - Fix various missplaced doc strings - Fix several double imports - Fix AnacondaKSScript.run: Module 'os' has no 'exists' member - users.py: Remove double definition of Users.setRootPassword - yuminstall.py: correct typo reop -> repo - yuminstall.py: _run: anaconda -> self.anaconda
* Do not write HWADDR to ifcfg file on s390x for OSA Layer 2 (#546005)David Cantrell2010-01-131-0/+3
| | | | | On s390x, if an interface is in OSA layer 2 mode, do not write the HWADDR setting to the ifcfg file.
* Do not modify /etc/hosts from setup package (#530343).David Cantrell2009-11-021-23/+0
| | | | | | | | | | Adding the user-specified hostname to the 127.0.0.1 line is breaking virt systems, among other things. I'm not entirely sure we need this functionality anymore (faking the hostname as 127.0.0.1). This reverts the changes done in 1aa67d5a2cdacd45f92ba15aa9392ba7191a49c7, but looking at the comments for #506384, you'll see the same complaints as #530343 has are present.
* Remove support for IUCV networking devices on s390. (#531494)David Cantrell2009-10-281-3/+1
| | | | | CONFIG_NETIUCV has been disabled in the kernel, so remove support for these devices during installation.
* Write LAYER2 and PORTNO correctly as parts of OPTIONS to ifcfg for s390xSteffen Maier2009-10-151-1/+1
| | | | | | | | | | | | | | | | | | On s390x, linuxrc.s390 brings up the network completely and writes an NM compliant /etc/sysconfig/network-scripts/ifcfg-<DEVICE>. Apparently, loader never hits STEP_IP or writeEnabledNetworkInfo(). The latter would convert LAYER2= and PORTNO= into OPTIONS="". Since it does not seem to be called, linuxrc.s390 now writes OPTIONS="". Fixed readIfcfgContents() to not swallow OPTIONS which contains '='. With this in place, network.py writes a correct ifcfg to /mnt/sysimage. This patch completes ifcfg production on s390x of the following commits: 25f58fe7c701c453d39d2a9c5c0850eefce07f76 9249e40f42ffbbdcf42cd1caad72e3d622c7a75b 5f0fcf6688d08f83826c2892bb9fc97d6b4d7dd0 81163960a6137d39a5f2082e9f8d9f0a7b2ada57 This patch is intended for both devel and F-12.
* Do not copy over 70-persistent.rules if instPath is '' (#527707)David Cantrell2009-10-071-1/+1
|
* Take 70-persistent-net.rules generated at installation (#526322)David Cantrell2009-10-061-24/+30
| | | | | | | | | | | | | | | | Discovered on s390x, but really affects all platforms. I've done test installs of RHEL-6 on s390x and of rawhide on x86_64 with this patch in place and 70-persistent-net.rules looks correct on the target system after installation. The problem on s390x was we needed to use the KERNELS setting for the line in the rules file, but on other platforms we don't need that. Since /lib/udev/write_net_rules is kicked off during installation, copy /etc/udev/rules.d/70-persistent-net.rules from the installation environment to the target system. If we don't have that file in the installation environment, just do what we have been doing (which should take care of the instances where people are doing kickstart installs with multiple network lines but onboot is set to no).
* Only write network --netmask if one has been defined (#527083).Chris Lumens2009-10-051-2/+4
|
* write ifname=eth#:MAC to kernel cmdline in grub.conf for dracutHans de Goede2009-09-151-29/+46
|
* Expose common fsset methods and properties in class Storage.David Cantrell2009-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add the following methods and properties to class Storage which map through to FSSet methods, modify existing calls to use the method on class Storage: turnOnSwap() mountFilesystems() umountFilesystems() parseFSTab() mkDevRoot() createSwapFile() fsFreeSpace() mtab mountpoints migratableDevices rootDevice Callers no longer need to pass the Anaconda object to the FSSet methods directly. The method on Storage takes care of that. The mtab() method on FSSet is exposed as a property on Storage. The same is true for fsFreeSpace().
* When bringing up network in UI, update only ifcfg file of selected device ↵Radek Vykydal2009-08-261-5/+9
| | | | | | | | | | (#507084). The value of NM_CONTROLLED has to change from no to yes to trigger device activation by updating of ifcfg file, so we need to update just the files of devices selected by user (instead of all devices). Otherwise, selection of another device after previously failed selection doesn't work. Also make writing out of ONBOOT in text mode consistent with gui.
* Fix backtrace in network.dracutSetupString in the static ip caseHans de Goede2009-08-051-3/+7
| | | | | | NetworkDevice.get() only takes one argument, iow its not like the standard get on a dictionary. This patch fixes the assumption that it is thereby fixing a backtrace when using static ip configuration.
* Add a dracutSetupString method to network.pyHans de Goede2009-08-041-0/+34
| | | | | | | | | Add a dracutSetupString method to network.py, this can be used to ask the Network class to get a dracut setup string to setup the interface needed for a connection to a certain host. This patch also adds code to booty to use this to get kernel cmdline dracut setup commands for any NIC's needed to connect to devices needed for /
* Fix selection of alternative iface in UI after fail (#507084).Radek Vykydal2009-07-201-1/+6
| | | | | | | | | | | | | Make ifcfg configuration files getting parsed properly after update. The used inotify configuration update mechanism (ifcfg-rh NM plugin) requires 1) writing of new files out of /etc/sysconfig/network-scripts dir so that it doesn't trigger parsing of the file too early (before all is written), and more importantly, 2) removing of the old files before moving the new ones in so that the new file gets parsed and the respective connection gets re-read and eventually activated. Also make sure that only device selected in UI has ONBOOT set to yes in case of selection of another device after fail.
* Write out NM_CONTROLLED=no for NICs used for FCoEHans de Goede2009-07-091-2/+2
| | | | | | | | | | Write out NM_CONTROLLED=no for NICs used for FCoE, note that unlike with iSCSI we do not blindly write out NM_CONTROLLED=no for all NICs, but just for the NIC which is used for FCoE. The iSCSI behaviour is undesirable, but the whole writing of NM_CONTROLLED=no for iSCSI will go away as soon as NetworkManager is fixed to not down devices when it takes over control, which should be fixed soon.
* Update /etc/hosts with hostname for loopback IP address (#506384)Radek Vykydal2009-07-071-0/+23
| | | | | Note: Compared to writing out of our own /etc/hosts which was removed in bug 491808, we do not write line for host's IP address.
* Move simpleconfig (back) into anaconda from rhplJeremy Katz2009-07-011-3/+1
|
* Test NM_CONTROLLED setting correctly in network.py (#502466)David Cantrell2009-06-021-4/+5
| | | | | | | | The only value we care about for NM_CONTROLLED is 'no', so change test to work that way. If performing a livecd install, make sure to carry over any NM_CONTROLLED settings in the ifcfg-* files on the live CD. Users with custom live images may have that set, so we should preserve it.
* Write out correct hostname during LiveCD installs (#492515)David Cantrell2009-05-061-4/+5
| | | | | | If doing a LiveCD install, make sure we write out HOSTNAME= in /etc/sysconfig/network and set it to the value entered in anaconda rather than localhost.localdomain.
* Avoid writing out NAME= in ifcfg files (#497485)David Cantrell2009-05-051-1/+1
| | | | | Not really necessary in the ifcfg files, so avoid writing out this value in network.py.
* Collect network interfaces from NetworkManager (#493995)David Cantrell2009-05-041-21/+19
| | | | | | | | | | Remove minihal.py and use NetworkManager to get a list of device names and their hardware addresses. Still have to talk to hal via D-Bus to build a description string, but the hal path is given to us by NetworkManager, so we are sure we are only building a list of interfaces that NetworkManager knows about and can communicate with. Also rewrite command-stubs/list-harddrives to not use minihal.
* Do not write /etc/hosts since setup owns that now (#491808)David Cantrell2009-03-301-46/+15
| | | | | | The setup package owns /etc/hosts and NetworkManager manages it once the system is running, so anaconda no longer needs to write out information to /etc/hosts during installation.
* Tell NM not to touch interfaces when / is on a network diskHans de Goede2009-03-171-5/+8
| | | | | | | | | | | | | | | | This patch renames storage.NetworkDevice to storage.NetworkStorageDevice, as NetworkDevice as classname also is used in network.py . It also changes NetworkStorageDevice so that it does not inherit from Device, as it is now intended for use in multiple inheritance together with StorageDevice (or a derived class) as explained further in the comments in the code. Then this patch changes iScsiDiskDevice and NFSDevice to additional inherit from NetworkStorageDevice (next to what they were already inheriting from. And last if fixes the code in network.py to properly write NM_CONTROLLED=NO when / uses a network backed device.
* Fix testing for whether a device requires networking.Chris Lumens2009-03-041-1/+2
| | | | | There's no more isNetdev method, so we'll have to use the type of the object as a test instead.
* Updates to make existing code use the new storage module.David Lehman2009-02-231-2/+2
|
* Fix a logic problem with network file write outs. (480769)Jesse Keating2009-01-211-4/+4
| | | | | | | | | | | | | | We're trying to cover two scenarios with a single if statement: The scenario pre-install where we're writing out files to the tmpfs in order to bring up the network. The scenario post-install where we're writing out files to the installed system for network on reboot. We're also trying to preserve any files that may be in the installed filesystem post-install time. The logic should now handle this. Signed-off-by: David Cantrell <dcantrell@redhat.com>
* Only skip (over)writing netconfig if we have an actual instPathJesse Keating2009-01-151-5/+5
| | | | | | | | | This fixes network bringup in anaconda itself where instPath is still ''. We were finding the pre-written stub config files outside of /mnt/sysimage and skipping any modifications to them. This kept NetworkManager from bringing up the device. Signed-off-by: David Cantrell <dcantrell@redhat.com>
* Initialize domainname to None (#477831)David Cantrell2008-12-231-0/+1
|
* Only write the short hostname to the localhost line (#474086)David Cantrell2008-12-171-8/+3
| | | | | | | | | | | | | Do not write the FQDN to the localhost line, only write the short hostname if it's something other than 'localhost'. Only write the FQDN line to /etc/hosts if we have an IP address for the host. Without this patch, users performing media installs who enter an FQDN in the hostname field end up with their FQDN == 127.0.0.1, which messes up things, such as sendmail. Writing the short name is what we really want here. [rawhide]
* Copy /etc/dhclient-DEV.conf file to target system (#476364)David Cantrell2008-12-161-2/+9
| | | | | | | | | | The vendor-class setting gets written to this file during installation, but we need to copy the file to the target system to make sure it's present on reboot. Previously, we wrote this to the ifcfg file for _something_ that read it, but it doesn't look like anything reads it from this location anymore (or ever). [rawhide]
* Do not write SEARCH line to ifcfg-DEVICE file (#474858)David Cantrell2008-12-051-4/+0
| | | | | | | | We have been writing the SEARCH= line to ifcfg files in network.py for a while, but it only contains the domain we extract from the FQDN. For users wanting to use the network service over NM, this presents a problem because the SEARCH line present in the ifcfg file will always override the information from the DHCP server.
* Preserve existing network configuration files during install (#461550)David Cantrell2008-12-051-77/+90
| | | | | | | | | | | | | | The suggestion for this patch came from OLPC (or someone with an @laptop.org email address). The user was doing a kickstart install and adding a local yum repo that provided an RPM of site-specific configuration files, including ifcfg-DEVICE files. This package would get installed just fine, but then anaconda drives over the configuration files after package installation. If we see any configuration file on the target system during installation, skip over it and don't write a new one. This should handle upgrades and kickstart install types like OLPC was describing.
* Prevent traceback for vnc installs on KVM guests (#470559)David Cantrell2008-11-081-1/+4
| | | | | | | | | | | | If you are installing in a KVM guest and pass 'vnc' on the boot line, getDefaultHostname() in network.py will traceback because anaconda.id contains nothing in this particular use case. Wrap the offending line in try/except and fall back on None if we can't pick the hostname from anaconda.id.network. For KVM installs, this causes vnc.py to report 'Please connect your vnc client to IPADDRESS:DISPLAY to begin the install', which is good enough for me.
* Make sure we look up the IP address for the correct device (#469439)David Cantrell2008-11-031-0/+30
| | | | | | | | | | | | | | | | | | | The VNC launch code in vnc.py needed an update to work better with NetworkManager. When collecting the hostname and IP address, it was assuming the first device in the netdevices list is our active NIC, which may or may not be true. Added getActiveNetDevs() in network.py to ask NetworkManager for a list of all currently configured interfaces. Return a list of device names. A list seems a bit pointless, but I'd like to have this in place now for future improvements where we might need to handle more than one active NIC during installation. After all, NM can do that. The message reported by anaconda once VNC is ready will contain the FQDN:DISPLAY_NUMBER (IP ADDRESS), if it can. If it can't find your IP address, it leaves that out. If it can't find your hostname, it also leaves that out.
* Only copy /etc/resolv.conf if instPath != '/'David Cantrell2008-10-291-1/+1
| | | | | | | | | Fixes a traceback seen where network.py tries to copy /etc/resolv.conf to /etc/resolv.conf. The original fix was to get DNS working in %post scripts during kickstart installs, but that fix assumed that when were in this block, instPath would be something (such as /mnt/sysimage). Only copy when instPath is some value other than ''.
* 'is not' -> '!='David Cantrell2008-10-291-1/+1
|
* Write --dhcpclass instead of --class to the anaconda ks file.Joel Granados Moreno2008-10-291-1/+1
|
* 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.