Change in vdsm[master]: netconfpersistence: refactor _getConfig and _clearDisk
Dan Kenigsberg has abandoned this change. Change subject: netconfpersistence: refactor _getConfig and _clearDisk .. Abandoned https://gerrit.ovirt.org/40415 -- To view, visit https://gerrit.ovirt.org/37418 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ifaf1cca94d184d079a06e07a9b4d5d2bcca42377 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: netconfpersistence: refactor _getConfig and _clearDisk
automat...@ovirt.org has posted comments on this change. Change subject: netconfpersistence: refactor _getConfig and _clearDisk .. Patch Set 1: * Update tracker::IGNORE, no Bug-Url found -- To view, visit https://gerrit.ovirt.org/37418 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifaf1cca94d184d079a06e07a9b4d5d2bcca42377 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: netconfpersistence: refactor _getConfig and _clearDisk
automat...@ovirt.org has posted comments on this change. Change subject: netconfpersistence: refactor _getConfig and _clearDisk .. Patch Set 1: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit http://gerrit.ovirt.org/37418 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifaf1cca94d184d079a06e07a9b4d5d2bcca42377 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: netconfpersistence: refactor _getConfig and _clearDisk
Dan Kenigsberg has posted comments on this change. Change subject: netconfpersistence: refactor _getConfig and _clearDisk .. Patch Set 1: Code-Review-1 (1 comment) http://gerrit.ovirt.org/#/c/37418/1/lib/vdsm/netconfpersistence.py File lib/vdsm/netconfpersistence.py: Line 123: return {} Line 124: else: Line 125: raise Line 126: Line 127: def _getConfigs(self, path): let's be more careful: do not ignore missing path. Instead, pre-create nets and bonds (in running and persistent config). Line 128: network_entities = {} Line 129: for fullpath in iglob(os.path.join(path, '*')): Line 130: basename = os.path.basename(fullpath) Line 131: network_entities[basename] = self._getConfigDict(fullpath) -- To view, visit http://gerrit.ovirt.org/37418 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifaf1cca94d184d079a06e07a9b4d5d2bcca42377 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: netconfpersistence: refactor _getConfig and _clearDisk
Ido Barkan has posted comments on this change. Change subject: netconfpersistence: refactor _getConfig and _clearDisk .. Patch Set 1: can you explain why less logging is desired in this case? -- To view, visit http://gerrit.ovirt.org/37418 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifaf1cca94d184d079a06e07a9b4d5d2bcca42377 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: netconfpersistence: refactor _getConfig and _clearDisk
oVirt Jenkins CI Server has posted comments on this change. Change subject: netconfpersistence: refactor _getConfig and _clearDisk .. Patch Set 1: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/15495/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/15327/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/14539/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_network_functional_tests_gerrit/2550/ : There was an infra issue, please contact in...@ovirt.org -- To view, visit http://gerrit.ovirt.org/37418 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifaf1cca94d184d079a06e07a9b4d5d2bcca42377 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: netconfpersistence: refactor _getConfig and _clearDisk
Dan Kenigsberg has uploaded a new change for review. Change subject: netconfpersistence: refactor _getConfig and _clearDisk .. netconfpersistence: refactor _getConfig and _clearDisk Does the same, with less lines of code and less logging. Change-Id: Ifaf1cca94d184d079a06e07a9b4d5d2bcca42377 Signed-off-by: Dan Kenigsberg --- M lib/vdsm/netconfpersistence.py 1 file changed, 13 insertions(+), 24 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/18/37418/1 diff --git a/lib/vdsm/netconfpersistence.py b/lib/vdsm/netconfpersistence.py index f0aac38..cd8b4e1 100644 --- a/lib/vdsm/netconfpersistence.py +++ b/lib/vdsm/netconfpersistence.py @@ -1,5 +1,5 @@ # -# Copyright 2013 Red Hat, Inc. +# Copyright 2013-2015 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,7 @@ # import errno +from glob import iglob import json import logging import os @@ -124,18 +125,12 @@ raise def _getConfigs(self, path): -networkEntities = {} -try: -for fileName in os.listdir(path): -fullPath = path + fileName -networkEntities[fileName] = self._getConfigDict(fullPath) -except OSError as ose: -if ose.errno == errno.ENOENT: -logging.debug('Non-existing config set.') -else: -raise +network_entities = {} +for fullpath in iglob(os.path.join(path, '*')): +basename = os.path.basename(fullpath) +network_entities[basename] = self._getConfigDict(fullpath) -return networkEntities +return network_entities @staticmethod def _setConfig(config, path): @@ -153,19 +148,13 @@ utils.rmFile(path) def _clearDisk(self): -try: -logging.info('Clearing %s and %s', self.networksPath, - self.bondingsPath) -for filePath in os.listdir(self.networksPath): -self._removeConfig(self.networksPath + filePath) +logging.info('Clearing %s and %s', self.networksPath, + self.bondingsPath) +for fullpath in iglob(os.path.join(self.networksPath, '*')): +self._removeConfig(fullpath) -for filePath in os.listdir(self.bondingsPath): -self._removeConfig(self.bondingsPath + filePath) -except OSError as ose: -if ose.errno == errno.ENOENT: -logging.debug('No existent config to clear.') -else: -raise +for fullpath in iglob(os.path.join(self.bondingsPath, '*')): +self._removeConfig(fullpath) def delete(self): self.networks = {} -- To view, visit http://gerrit.ovirt.org/37418 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifaf1cca94d184d079a06e07a9b4d5d2bcca42377 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches