Revision 8533cd2d test/py/ganeti.config_unittest.py
b/test/py/ganeti.config_unittest.py | ||
---|---|---|
104 | 104 |
bootstrap.InitConfig(constants.CONFIG_VERSION, |
105 | 105 |
cluster_config, master_node_config, self.cfg_file) |
106 | 106 |
|
107 |
def _create_instance(self): |
|
107 |
def _create_instance(self, cfg):
|
|
108 | 108 |
"""Create and return an instance object""" |
109 | 109 |
inst = objects.Instance(name="test.example.com", |
110 | 110 |
uuid="test-uuid", |
111 | 111 |
disks=[], nics=[], |
112 | 112 |
disk_template=constants.DT_DISKLESS, |
113 |
primary_node=self._get_object().GetMasterNode(),
|
|
113 |
primary_node=cfg.GetMasterNode(),
|
|
114 | 114 |
osparams_private=serializer.PrivateDict()) |
115 | 115 |
return inst |
116 | 116 |
|
... | ... | |
162 | 162 |
"""Test updates on one instance object""" |
163 | 163 |
cfg = self._get_object() |
164 | 164 |
# construct a fake instance |
165 |
inst = self._create_instance() |
|
165 |
inst = self._create_instance(cfg)
|
|
166 | 166 |
fake_instance = objects.Instance() |
167 | 167 |
# fail if we didn't read the config |
168 | 168 |
self.failUnlessRaises(errors.ConfigurationError, cfg.Update, fake_instance, |
Also available in: Unified diff