Commit f9116d58 authored by Guido Trotter's avatar Guido Trotter
Browse files

GanetiLockManager, remove default values



The nodes and instances parameters to the constructor are mandatory
anyway, as a value of None will fail when creating the LockSet. Rather
than fixing this adding code lines, since we never used the default
value, let's remove them and require that the parameters are passed.

This also fixes the only places where we inited GanetiLockManager with
keyed parameters and without arguments.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 4badc36c
......@@ -1367,7 +1367,7 @@ class GanetiLockManager:
"""
_instance = None
def __init__(self, nodes=None, instances=None):
def __init__(self, nodes, instances):
"""Constructs a new GanetiLockManager object.
There should be only a GanetiLockManager object at any time, so this
......
......@@ -1419,8 +1419,7 @@ class TestGanetiLockManager(_ThreadedTestCase):
_ThreadedTestCase.setUp(self)
self.nodes=['n1', 'n2']
self.instances=['i1', 'i2', 'i3']
self.GL = locking.GanetiLockManager(nodes=self.nodes,
instances=self.instances)
self.GL = locking.GanetiLockManager(self.nodes, self.instances)
def tearDown(self):
# Don't try this at home...
......@@ -1435,7 +1434,7 @@ class TestGanetiLockManager(_ThreadedTestCase):
self.assertEqual(i, locking.LEVELS[i])
def testDoubleGLFails(self):
self.assertRaises(AssertionError, locking.GanetiLockManager)
self.assertRaises(AssertionError, locking.GanetiLockManager, [], [])
def testLockNames(self):
self.assertEqual(self.GL._names(locking.LEVEL_CLUSTER), set(['BGL']))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment