diff options
author | Jesse Keating <jkeating@redhat.com> | 2009-11-09 11:39:34 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2009-11-09 22:19:23 +0100 |
commit | 19faf576193302f78cdd058481f78d56b96a150a (patch) | |
tree | b056173fdfa060a14ed4d4c9f0ab6ff85bc76487 /yuminstall.py | |
parent | a9e2e9a40532120ad9545cf677a65d6727b21c10 (diff) | |
download | anaconda-19faf576193302f78cdd058481f78d56b96a150a.tar.gz anaconda-19faf576193302f78cdd058481f78d56b96a150a.tar.xz anaconda-19faf576193302f78cdd058481f78d56b96a150a.zip |
Convert string.find calls into something modern
string.find('foo') != -1 is a bit klunky. We now have the ability to
just do 'foo' in string and get back a True or False from that. I'm
sure there are more files in anaconda that could use this treatment but
this is the file I was looking at anyway.
Diffstat (limited to 'yuminstall.py')
-rw-r--r-- | yuminstall.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/yuminstall.py b/yuminstall.py index 0eb428abf..76c7f6446 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -557,13 +557,13 @@ class AnacondaYum(YumSorter): repo.yumvar.update(self.conf.yumvar) repo.cfg = parser - if repo.id.find("-source") != -1 or repo.id.find("-debuginfo") != -1: + if "-source" in repo.id or "-debuginfo" in repo.id: name = repo.name del(repo) raise RepoError, "Repo %s contains -source or -debuginfo, excluding" % name # this is a little hard-coded, but it's effective - if not BETANAG and (repo.id.find("rawhide") or repo.id.find("development")): + if not BETANAG and ("rawhide" in repo.id or "development" in repo.id): name = repo.name del(repo) raise RepoError, "Excluding devel repo %s for non-devel anaconda" % name @@ -1547,7 +1547,7 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon supportedUpgradeVersion = 1 break - if productName.find("Red Hat Enterprise Linux") == -1: + if "Red Hat Enterprise Linux" not in productName: supportedUpgradeVersion = 1 if supportedUpgradeVersion == 0: |