Sandro Bonazzola has posted comments on this change. Change subject: reports: remove war file for new db ......................................................................
Patch Set 5: (2 comments) http://gerrit.ovirt.org/#/c/28653/5/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-reports/jasper/deploy.py File packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-reports/jasper/deploy.py: Line 139: try: Line 140: if entry['dst'] is not None and os.path.exists(entry['src']): Line 141: shutil.rmtree(entry['src']) Line 142: if entry['dst'] is not None: Line 143: os.rename(entry['dst'], entry['src']) I suggest: if entry['dst'] is not None: try: shutil.rmtree(entry['src']) except OSError....: # handle no exist case # raise again for other cases os.rename(entry['dst'], entry['src']) Line 144: except Exception as e: Line 145: self._parent.logger.debug( Line 146: 'Exception during rename %s->%s', Line 147: entry['dst'], Line 160: ) Line 161: Line 162: def commit(self): Line 163: for entry in self._restore: Line 164: if entry['dst'] is not None and os.path.exists(entry['dst']): Here too, I would have called rmtree and handled noexist. Line 165: shutil.rmtree(entry['dst']) Line 166: Line 167: def _buildJs(self, cmd, config, noSuffix=False): Line 168: -- To view, visit http://gerrit.ovirt.org/28653 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iabf039c1ba864a1f3b7d84443e1bc4538919e6fd Gerrit-PatchSet: 5 Gerrit-Project: ovirt-reports Gerrit-Branch: master Gerrit-Owner: Shirly Radco <sra...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com> Gerrit-Reviewer: Shirly Radco <sra...@redhat.com> Gerrit-Reviewer: Simone Tiraboschi <stira...@redhat.com> Gerrit-Reviewer: Yaniv Dary <yd...@redhat.com> Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches