Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   Quote values when writing out to ifcfg files (#520146) (http://www.linux-archive.org/gentoo-user/363026-quote-values-when-writing-out-ifcfg-files-520146-a.html)

Steffen Maier 04-28-2010 12:03 AM

Quote values when writing out to ifcfg files (#520146)
 
I like that one.
Hoperfully, we never have to do funny workarounds for ifcfg option
values containing white space like in
8549a36d4b22171992951a272b82f0aa14234dc4 from now on.

On 04/27/2010 10:49 AM, Radek Vykydal wrote:
> ---
> network.py | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/network.py b/network.py
> index e353a79..974784f 100644
> --- a/network.py
> +++ b/network.py
> @@ -272,7 +272,7 @@ class NetworkDevice(IfcfgFile):
> elif key == 'ETHTOOL_OPTS' and self.info[key].find("autoneg")== -1:
> s = s + key + """="autoneg off %s"
""" % (self.info[key])
> elif self.info[key] is not None:
> - s = s + key + "=" + self.info[key] + "
"
> + s = s + key + '="' + self.info[key] + '"
'
>
> return s
>

Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


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

David Cantrell 05-04-2010 02:45 AM

Quote values when writing out to ifcfg files (#520146)
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ack.

On Tue, 27 Apr 2010, Radek Vykydal wrote:


---
network.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/network.py b/network.py
index e353a79..974784f 100644
--- a/network.py
+++ b/network.py
@@ -272,7 +272,7 @@ class NetworkDevice(IfcfgFile):
elif key == 'ETHTOOL_OPTS' and self.info[key].find("autoneg")== -1:
s = s + key + """="autoneg off %s"
""" % (self.info[key])
elif self.info[key] is not None:
- s = s + key + "=" + self.info[key] + "
"
+ s = s + key + '="' + self.info[key] + '"
'

return s




- --
David Cantrell <dcantrell@redhat.com>

Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkvfimcACgkQ5hsjjIy1VkmBuQCfcSeexfEIiq n8mBASmCkOfLQ6
22UAoIcCE/fsJiOBLIF0hGOsF6r5tjSK
=6EZe
-----END PGP SIGNATURE-----

_______________________________________________
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 07:03 PM.

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