def test__parse_root_device_hints(self): hints = {"wwn": "fake wwn", "size": "12345", "rotational": True} expected = {"wwn": "fake wwn", "size": 12345, "rotational": True} props = self.node.properties props['root_device'] = hints self.node.properties = props self.node.save() with task_manager.acquire(self.context, self.node.uuid) as task: self.assertEqual( expected, ansible_deploy._parse_root_device_hints(task.node))
def test__parse_root_device_hints_iinfo(self): hints = {"wwn": "fake wwn", "size": "12345", "rotational": True, "serial": "HELLO"} expected = {"wwn": "fake wwn", "size": 12345, "rotational": True, "serial": "hello"} iinfo = self.node.instance_info iinfo['root_device'] = hints self.node.instance_info = iinfo self.node.save() with task_manager.acquire(self.context, self.node.uuid) as task: self.assertEqual( expected, ansible_deploy._parse_root_device_hints(task.node))