Alon Bar-Lev has uploaded a new change for review.

Change subject: packagers: yum: ignore sack cache populate errors
......................................................................

packagers: yum: ignore sack cache populate errors

for some reason yum when going to cache only mode tries to download
online repositories, and if fails cause the entire transaction to fail.

more over, when going online, it also tries to download online
resources, and if fails cause the entire transaction to fail.

any network issue during this stage will create an undesired failure. so
just ignore these errors and hope for the best, as this sequence is only
used when transaction is rollbacked.

Change-Id: I6f6cba0071da862addcb438d47ac9401f746ee87
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M src/otopi/miniyum.py
1 file changed, 23 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/07/17107/1

diff --git a/src/otopi/miniyum.py b/src/otopi/miniyum.py
index d6d91cf..ee5c313 100755
--- a/src/otopi/miniyum.py
+++ b/src/otopi/miniyum.py
@@ -655,18 +655,36 @@
                             try:
                                 self._yb.repos.populateSack(
                                     mdtype='all',
-                                    cacheonly=1
+                                    cacheonly=1,
                                 )
+                            except Exception as e:
+                                self._sink.verbose(
+                                    _(
+                                        'Cannot switch to offline: {error}'
+                                    ).format(
+                                        error=e,
+                                    )
+                                )
+                            try:
                                 del self._yb.tsInfo
                                 del self._yb.ts
                                 if self._yb.history_undo(transactionCurrent):
                                     if self.buildTransaction():
                                         self.processTransaction()
                             finally:
-                                self._yb.repos.populateSack(
-                                    mdtype='all',
-                                    cacheonly=0
-                                )
+                                try:
+                                    self._yb.repos.populateSack(
+                                        mdtype='all',
+                                        cacheonly=0,
+                                    )
+                                except Exception as e:
+                                    self._sink.verbose(
+                                        _(
+                                            'Cannot switch to online: {error}'
+                                        ).format(
+                                            error=e,
+                                        )
+                                    )
 
             except:
                 self._sink.error(


-- 
To view, visit http://gerrit.ovirt.org/17107
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f6cba0071da862addcb438d47ac9401f746ee87
Gerrit-PatchSet: 1
Gerrit-Project: otopi
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to