[PATCH rhel7-branch] Check also ipv6 default routes when looking for onboot=yes device (#1185280)
Brian C. Lane
bcl at redhat.com
Mon Jun 15 16:14:58 UTC 2015
On Mon, Jun 15, 2015 at 02:29:27PM +0200, Radek Vykydal wrote:
> Resolves: rhbz#1185280
> ---
> pyanaconda/installclasses/rhel.py | 3 ++-
> pyanaconda/network.py | 8 ++++----
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/pyanaconda/installclasses/rhel.py b/pyanaconda/installclasses/rhel.py
> index be9135b..e1ca310 100644
> --- a/pyanaconda/installclasses/rhel.py
> +++ b/pyanaconda/installclasses/rhel.py
> @@ -58,7 +58,8 @@ class RHELBaseInstallClass(BaseInstallClass):
> return
> # choose the device used during installation
> # (ie for majority of cases the one having the default route)
> - dev = network.default_route_device()
> + dev = network.default_route_device() \
> + or network.default_route_device(family="inet6")
> if not dev:
> return
> # ignore wireless (its ifcfgs would need to be handled differently)
> diff --git a/pyanaconda/network.py b/pyanaconda/network.py
> index 079946d..1b7607a 100644
> --- a/pyanaconda/network.py
> +++ b/pyanaconda/network.py
> @@ -893,10 +893,10 @@ def ifaceForHostIP(host):
>
> return routeInfo[routeInfo.index("dev") + 1]
>
> -def default_route_device():
> - routes = iutil.execWithCapture("ip", ["route", "show"])
> +def default_route_device(family="inet"):
> + routes = iutil.execWithCapture("ip", [ "-f", family, "route", "show"])
> if not routes:
> - log.error("Could not get default route device")
> + log.debug("Could not get default %s route device", family)
> return None
>
> for line in routes.split("\n"):
> @@ -905,7 +905,7 @@ def default_route_device():
> if len(parts) >= 5 and parts[3] == "dev":
> return parts[4]
> else:
> - log.error("Could not parse default route device: %s", line)
> + log.debug("Could not parse default %s route device", family)
> return None
>
> return None
> --
> 1.9.3
Ack
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
More information about the anaconda-patches
mailing list