summaryrefslogtreecommitdiffstats
path: root/network.py
Commit message (Collapse)AuthorAgeFilesLines
* Structure the repo layout so it matches final structure better and make isys ↵Martin Sivak2010-05-311-897/+0
| | | | | | a real Python package. Also updates the build and autotools stuff to work with the new structure
* Use correct NM dbus interfaces (#594716)Radek Vykydal2010-05-241-10/+11
|
* Make ssid and wepkey in boot params and stage 1 kickstart work (#473803)Radek Vykydal2010-05-241-1/+1
|
* Fix bad patches reordering (#473803)Radek Vykydal2010-05-141-2/+7
| | | | | This bit got lost when I was separating wireless support from nm-c-e patches which results in traceback.
* Don't ask if we have ESSID specified by kickstart or stage 1 (#473803)Radek Vykydal2010-05-131-2/+6
|
* Make ks option network --wepkey work in stage 2 (#473803)Radek Vykydal2010-05-131-16/+30
|
* Add support for wireless configuration using nm-c-e in stage 2 (#473803)Radek Vykydal2010-05-131-0/+61
|
* Write out ifcfg files only when necessary (#520146)Radek Vykydal2010-05-131-11/+35
| | | | | | | | Writing the files so often is not necessary, and can cause timing issues (NM itself updates the files after we write them out) which can result in duplicated connections nm-c-e list. Write the file only if some value in NetworkDevice object has been actually changed.
* Use separate method for copying network configuration to system (#520146).Radek Vykydal2010-05-131-86/+91
| | | | | | | | | | | | | | Former Network.write was used to write config both to anaconda environment and to installed system. It became quite messy and unreadable doing both things as writing to installed system was just copying the file from anaconda root to system root for all files except ifcfg-DEVICE. Using two separate methods makes clear what we are doing. Also there is a question if we need to copy the network config to system twice as we are doing - first in preinstall step, and then in writeconfig step. The latter is not necessary I think and seem to be actually a noop.
* Network: remove functions that are not used anymore (#520146)Radek Vykydal2010-05-131-47/+0
|
* Wait for specific activated network devices (#520146).Radek Vykydal2010-05-131-1/+28
| | | | | | | | | | | | | | We used to activate just one device when enabling network, so it was ok to use waitForConnection (wait just for any connection). Now that more devices can be set to be activated in nm-c-e (by checking [] Connect automatically), we should (1) Wait for all devices activated by nm-c-e this way, otherwise we can fail with traceback in next steps reading device configuration. (2) When enabling network make sure the device selected by user in combobox was activated, not just any device.
* Remove no longer needed devices argument from Network.write() (#520146)Radek Vykydal2010-05-131-5/+4
| | | | | | | Now when we set NM_CONTROLLED parameter more carefully before writing a device, this parameter introduced by patch 898a891c is no longer needed. OTOH it doesn't break anything and may become handy in the future.
* Actually generate contents of 70-persistent-net.rules (#520146)Radek Vykydal2010-05-131-1/+1
| | | | | | I don't know if it really causes any problems right now, just noticed it when working on nm-c-e configuration in stage 2. Introduced by typo in commit 0ba6cb516da384e30efdd0dbd70a6c12336fd4f5.
* Do not mess value change with line formatting (#520146)Radek Vykydal2010-05-131-4/+6
| | | | | | Format the line only at single place, and when modifying value of parameter to be written-out, change also its value in the NetworkDevice object accordingly.
* Log change of ifcfg files by nm-c-e (#520146)Radek Vykydal2010-05-131-0/+22
| | | | Log file is /tmp/ifcfg.log.
* Enable networking in stage 2 using nm-c-e (#520146)Radek Vykydal2010-05-131-7/+36
| | | | | | | | | | | | | | | | | | | | Key patch of series. enableNetwork method is the root of all other changes in the patchset. The method is used both for network enabling in stage 2 triggered by need of network (repos, network storage, etc..) and [Configure Network] button What we select in stage 2 network UI is: - device to be activated (only in case of network enabling), this is controlled by ONBOOT ifcfg setting, note that devices actually activated depend on editing in nm-c-e - devices to be controlled by NM (and thus visible in nm-c-e), this is set by NM_CONTROLLED ifcfg setting A dialog for that is part of the patch, it needs some polishing. bringUp method had to be split into write and waitForConnection because in case of just config, without actually activating any device in nm-c-e, we don't want to wait for activation.
* Write ifcfg files via NetworkDevice in Network.write() method (#520146)Radek Vykydal2010-05-131-53/+4
| | | | | Now that NetworkDevice objects are backed with IfcfgFile, use its method to write the device's ifcfg file.
* Use ifcfg files via NetworkDevice in Network class (#520146)Radek Vykydal2010-05-131-124/+35
| | | | | | | | | | | | | | | | | Remove reading of some keys from NM via dbus, count on ifcfg file contents (written by stage 1, ks, or nm-c-e). This should also ensure support for ipv6 in stage2 using nm-c-e. Remove available() method - it is useless - HWADDR is read from ifcfg file, description is set in constructor, and Network class will be kept up-to-date (e.g. after configuring with nm-c-e) by explicit call to added update() method. readIfcfgContets became useless, we can use (now ifcfg-backed) NetworkDevices' method loadIfcfgFile instead. Hunk starting with if len(available_devices) > 0: is a noop, probably some leftover - removing.
* Use proper attribute instead of NetworkDevice 'DESC' hack (#520146)Radek Vykydal2010-05-131-4/+3
| | | | | Note: other occurences of 'DESC' usage are replaced in following patches.
* Quote values when writing out to ifcfg files (#520146)Radek Vykydal2010-05-131-1/+1
|
* Network.__str__() little cleanup (#520146)Radek Vykydal2010-05-131-1/+1
| | | | | Have line formatting only at one place, common for all keys (at the end of __str__ method)
* Use IfcfgFile class to back NetworkDevice objects (#520146)Radek Vykydal2010-05-131-6/+53
|
* Move some consts to module globals for use in other places (#520146)Radek Vykydal2010-05-131-3/+7
|
* Strip quoting from OPTIONS when composing rd_CCW line (#577193).David Cantrell2010-04-301-1/+1
| | | | | OPTIONS line may contain shell quoting, make sure to strip that out when constructing the rd_CCW line for dracut.
* Simplify HWADDR removal check on s390x (#546005)David Cantrell2010-04-141-2/+1
| | | | We do not want to write out HWADDR for any network device type on s390x.
* network.dracutSetupString(): handle hosts outside the subnet (#577193)Hans de Goede2010-03-311-2/+3
| | | | | | | | | | Out "ip route" output parsing did not handle the "ip route" output properly in the case we were trying to find out which interface is used to get to a host when that host lives outside our subnet. This patch fixes this. Note this only fixes part of #577193, but as the other part is really unrelated I'm splitting the fix into 2 patches.
* Write rd_CCW when root fs is on a network device on s390x (#577193)David Cantrell2010-03-311-0/+13
| | | | | | | | The dracutSetupString() method in the Network class needed to write out the rd_CCW parameter, which is necessary for network devices on s390x. The format is described in the dracut(8) man page. The required information has always been written to the ifcfg-DEVICE file, so we just need to make sure it gets to dracut as well.
* 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.