Ala Hino has uploaded a new change for review. Change subject: gluster: Don't throw exception if volume is not replica 3 ......................................................................
gluster: Don't throw exception if volume is not replica 3 Prior to this patch, if non-replica 3 volume is used, we throw an exception failing the operation. That support wasn't good because it failed upgrade process. This patch removes throwing the exception and logs a warning indicating that non-replica 3 is used. Change-Id: I359e2405153f45b6ae303e00eb0e04a5ae14cb99 Signed-off-by: Ala Hino <ah...@redhat.com> --- M tests/storageServerTests.py M vdsm/storage/storageServer.py 2 files changed, 7 insertions(+), 9 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/50119/1 diff --git a/tests/storageServerTests.py b/tests/storageServerTests.py index 70f71ca..13cb27e 100644 --- a/tests/storageServerTests.py +++ b/tests/storageServerTests.py @@ -25,7 +25,6 @@ from storage.storageServer import IscsiConnection from storage.storageServer import MountConnection from storage import storageServer -from storage import storage_exception as se class FakeSupervdsm(object): @@ -228,8 +227,8 @@ @MonkeyPatch(storageServer, 'supervdsm', FakeSupervdsm()) @MonkeyPatch(GlusterFSConnection, 'ALLOWED_REPLICA_COUNTS', ('1', '3')) - @permutations([['1', True], ['2', False], ['3', True], ['4', False]]) - def test_allowed_gluster_replica_count(self, replica_count, supported): + @permutations([['1'], ['2'], ['3'], ['4']]) + def test_allowed_gluster_replica_count(self, replica_count): def glusterVolumeInfo(volumeName=None, remoteServer=None): return {'music': {'replicaCount': replica_count}} @@ -237,8 +236,4 @@ storageServer.supervdsm.glusterVolumeInfo = glusterVolumeInfo gluster = GlusterFSConnection(spec="192.168.122.1:/music") - if supported: - gluster.validate() - else: - self.assertRaises(se.UnsupportedGlusterVolumeReplicaCountError, - gluster.validate) + gluster.validate() diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py index 2063045..2b75939 100644 --- a/vdsm/storage/storageServer.py +++ b/vdsm/storage/storageServer.py @@ -335,7 +335,10 @@ def validate(self): replicaCount = self.volinfo['replicaCount'] if replicaCount not in self.ALLOWED_REPLICA_COUNTS: - raise se.UnsupportedGlusterVolumeReplicaCountError(replicaCount) + self.log.warning("Volume replica count is %s. " + "This replica count is NOT supported. " + "Please upgrade your volume to replica 3.", + replicaCount) def _get_backup_servers_option(self): servers = utils.unique(brick.split(":")[0] for brick -- To view, visit https://gerrit.ovirt.org/50119 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I359e2405153f45b6ae303e00eb0e04a5ae14cb99 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ala Hino <ah...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches