[PATCH] Github issue #630: fixing None.strip() error

This simple patch fixes the scenario in repositories.py where baseurl or mirrorlist is None and the code was executing baseurl.strip() and mirrorlist.strip(), leading to errors in tests/test_model.py (test_repository_update) and probably other bugs. Signed-off-by: Daniel Henrique Barboza <dhbarboza82@gmail.com> --- src/kimchi/repositories.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kimchi/repositories.py b/src/kimchi/repositories.py index f1e1eb3..19c5810 100644 --- a/src/kimchi/repositories.py +++ b/src/kimchi/repositories.py @@ -275,10 +275,10 @@ class YumRepo(object): config = params.get('config', {}) mirrorlist = config.get('mirrorlist', None) - if len(baseurl.strip()) == 0: + if baseurl is not None and len(baseurl.strip()) == 0: baseurl = None - if len(mirrorlist.strip()) == 0: + if mirrorlist is not None and len(mirrorlist.strip()) == 0: mirrorlist = None if baseurl is None and mirrorlist is None: -- 1.9.3

This issue has already been fixed by the patch "[PATCH 1/3] Handle empty variables when updating YUM repository" which I sent last week. It just hasn't been committed yet due to another patch in that series which needs more work. On 30-03-2015 13:49, Daniel Henrique Barboza wrote:
This simple patch fixes the scenario in repositories.py where baseurl or mirrorlist is None and the code was executing baseurl.strip() and mirrorlist.strip(), leading to errors in tests/test_model.py (test_repository_update) and probably other bugs.
Signed-off-by: Daniel Henrique Barboza <dhbarboza82@gmail.com> ---

Oh ok! Care to comment in the github entry to mention that? Thanks! On 03/30/2015 04:17 PM, Crístian Viana wrote:
This issue has already been fixed by the patch "[PATCH 1/3] Handle empty variables when updating YUM repository" which I sent last week. It just hasn't been committed yet due to another patch in that series which needs more work.
On 30-03-2015 13:49, Daniel Henrique Barboza wrote:
This simple patch fixes the scenario in repositories.py where baseurl or mirrorlist is None and the code was executing baseurl.strip() and mirrorlist.strip(), leading to errors in tests/test_model.py (test_repository_update) and probably other bugs.
Signed-off-by: Daniel Henrique Barboza <dhbarboza82@gmail.com> ---
participants (2)
-
Crístian Viana
-
Daniel Henrique Barboza