Skip to content

Commit

Permalink
network: network.py cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rvykydal committed Mar 15, 2019
1 parent 400df3e commit 8bdcce8
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 90 deletions.
4 changes: 2 additions & 2 deletions pyanaconda/bootloader/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,15 +764,15 @@ def _set_storage_boot_args(self, storage):
# network storage
# XXX this is nothing to be proud of
if isinstance(dep, NetworkStorageDevice):
setup_args = pyanaconda.network.dracutSetupArgs(dep)
setup_args = pyanaconda.network.dracut_setup_args(dep)
self.boot_args.update(setup_args)
self.dracut_args.update(setup_args)

# This is needed for FCoE, bug #743784. The case:
# We discover LUN on an iface which is part of multipath setup.
# If the iface is disconnected after discovery anaconda doesn't
# write dracut ifname argument for the disconnected iface path
# (in Network.dracutSetupArgs).
# (in network.dracut_setup_args).
# Dracut needs the explicit ifname= because biosdevname
# fails to rename the iface (because of BFS booting from it).
for nic in fcoe_proxy.GetNics():
Expand Down
6 changes: 3 additions & 3 deletions pyanaconda/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ class WriteResolvConfTask(Task):
"""

def run_task(self):
"""Resolve the sysroot path only right before doing the copy operatio.
"""Resolve the sysroot path only right before doing the copy operation.
If we just added the sysroot path as an argument, it would be resolved when the
task queue was created, not when the task is actually executed, which could
theoretically result in an incorrect path.
"""
network.copyFileToPath("/etc/resolv.conf", util.getSysroot())
network.copy_resolv_conf_to_root(util.getSysroot())


def _writeKS(ksdata):
Expand Down Expand Up @@ -315,7 +315,7 @@ def wait_for_all_treads():
if conf.system.provides_resolver_config:
# we use a custom Task subclass as the sysroot path has to be resolved
# only when the task is actually started, not at task creation time
pre_install.append(WriteResolvConfTask("Copy /resolv.conf to sysroot"))
pre_install.append(WriteResolvConfTask("Copy resolv.conf to sysroot"))

def run_pre_install():
"""This means to gather what additional packages (if any) are needed & executing payload.pre_install()."""
Expand Down
4 changes: 3 additions & 1 deletion pyanaconda/kickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,9 @@ def setup(self):

def execute(self, payload):
fcoe_proxy = STORAGE.get_proxy(FCOE)
fcoe_ifaces = network.get_devices_by_nics(fcoe_proxy.GetNics())
fcoe_nics = fcoe_proxy.GetNics()
fcoe_ifaces = [dev.device_name for dev in network.get_supported_devices()
if dev.device_name in fcoe_nics]
overwrite = network.can_overwrite_configuration(payload)
network_proxy = NETWORK.get_proxy()
task_path = network_proxy.InstallNetworkWithTask(util.getSysroot(),
Expand Down
Loading

0 comments on commit 8bdcce8

Please sign in to comment.