Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Kubuntu User (http://www.linux-archive.org/kubuntu-user/)
-   -   dracut parse-kickstart: don't write empty "nameserver=" (http://www.linux-archive.org/kubuntu-user/663162-dracut-parse-kickstart-dont-write-empty-nameserver.html)

Will Woods 05-04-2012 05:47 PM

dracut parse-kickstart: don't write empty "nameserver="
 
This can actually cause some problems because "getarg nameserver" will
return "1" for the argument "nameserver=", which means you end up with
DNS1=1 in your ifcfg, which is obviously wrong.
---
dracut/parse-kickstart | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 0c81108..aa4e0e8 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -189,7 +189,8 @@ def ksnet_to_dracut(args, lineno, net, bootdev=False):
line.append("ip=%s" % ip)

for ns in net.nameserver.split(","):
- line.append("nameserver=%s" % ns)
+ if ns:
+ line.append("nameserver=%s" % ns)

if net.mtu:
# XXX FIXME: dracut doesn't support mtu= (yet)
--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

"Brian C. Lane" 05-04-2012 06:39 PM

dracut parse-kickstart: don't write empty "nameserver="
 
On Fri, May 04, 2012 at 01:47:27PM -0400, Will Woods wrote:
> This can actually cause some problems because "getarg nameserver" will
> return "1" for the argument "nameserver=", which means you end up with
> DNS1=1 in your ifcfg, which is obviously wrong.
> ---
> dracut/parse-kickstart | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
> index 0c81108..aa4e0e8 100755
> --- a/dracut/parse-kickstart
> +++ b/dracut/parse-kickstart
> @@ -189,7 +189,8 @@ def ksnet_to_dracut(args, lineno, net, bootdev=False):
> line.append("ip=%s" % ip)
>
> for ns in net.nameserver.split(","):
> - line.append("nameserver=%s" % ns)
> + if ns:
> + line.append("nameserver=%s" % ns)
>
> if net.mtu:
> # XXX FIXME: dracut doesn't support mtu= (yet)
> --
> 1.7.7.6

Ack

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 06:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.