FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Marketing

 
 
LinkBack Thread Tools
 
Old 05-10-2010, 03:23 PM
Chris Lumens
 
Default Be more resilient to config files missing sections and options (#590591).

---
yuminstall.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index 3d8c318..1d54f24 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -607,16 +607,17 @@ class AnacondaYum(YumSorter):
variant = c.get("general", "variant")

section = "variant-%s" % variant
- if c.has_section(section):
+ if c.has_section(section) and c.has_option(section, "addons"):
validAddons = c.get(section, "addons").split(",")
else:
return retval

for addon in validAddons:
- if not c.has_section("addon-%s" % addon):
+ addonSection = "addon-%s" % addon
+ if not c.has_section(addonSection) or not c.has_option(addonSection, "repository"):
continue

- url = "%s/%s" % (baseurl, c.get("addon-%s" % addon, "repository"))
+ url = "%s/%s" % (baseurl, c.get(addonSection, "repository"))
retval.append((addon, url))

return retval
--
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-10-2010, 03:57 PM
"Brian C. Lane"
 
Default Be more resilient to config files missing sections and options (#590591).

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/10/2010 08:23 AM, Chris Lumens wrote:
> ---
> yuminstall.py | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/yuminstall.py b/yuminstall.py
> index 3d8c318..1d54f24 100644
> --- a/yuminstall.py
> +++ b/yuminstall.py
> @@ -607,16 +607,17 @@ class AnacondaYum(YumSorter):
> variant = c.get("general", "variant")
>
> section = "variant-%s" % variant
> - if c.has_section(section):
> + if c.has_section(section) and c.has_option(section, "addons"):
> validAddons = c.get(section, "addons").split(",")
> else:
> return retval
>
> for addon in validAddons:
> - if not c.has_section("addon-%s" % addon):
> + addonSection = "addon-%s" % addon
> + if not c.has_section(addonSection) or not c.has_option(addonSection, "repository"):
> continue
>
> - url = "%s/%s" % (baseurl, c.get("addon-%s" % addon, "repository"))
> + url = "%s/%s" % (baseurl, c.get(addonSection, "repository"))
> retval.append((addon, url))
>
> return retval

ACK

- --
Brian C. Lane <bcl@redhat.com>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEVAwUBS+gs5xF+jBaO/jp/AQIohQgAhi8/cvhfdGrRB25d0dHnFXIuCYLVTh/N
tnIZKyuYU4+JrOSlekXNVcWLA7VrjkOWP3oEMN9fJpS+50FH0/TwlBERm3tI6nSQ
8cwa/BvopTy+dltUeYw+3maGFUJvd6jM0h8fJl3bRHAMTvKC8z5GDKH 2GFsZtO+R
LIQYVZCcqjdBauSO+WpeBkw+Dd/KNYDLWuFYr9MW1SsIdR7L9VyahvaIhemQVSod
Z1M2ifRZ+KQEnO+/LeLLEYhGq4hh1hqDGFqgokRz75LH/yEK59nwMbbGyuytnKD9
KAwHwMIkatqNoDYX/facOqE7XjlbJU2zUWFlJg9ZugKshcQH8zFXKg==
=dC74
-----END PGP SIGNATURE-----

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

Thread Tools




All times are GMT. The time now is 02:47 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org