After upgrading to libcloud>=0.16, it's redundant to create a node
with ex_disk_auto_delete=True, then destroy the node with
destory_boot_disk=True. During the destroy process, libcloud will
fail to destroy the boot disk, because Google has already deleted it.
ex_disk_auto_delete is closer to what we want, so just rely on that.
super(ComputeNodeDriver, self).list_nodes()
if self.node_tags.issubset(node.extra.get('tags', []))]
- def destroy_node(self, cloud_node):
- return super(ComputeNodeDriver, self).destroy_node(
- cloud_node, destroy_boot_disk=True)
-
@classmethod
def _find_metadata(cls, metadata_items, key):
# Given a list of two-item metadata dictonaries, return the one with
driver = self.new_driver(list_kwargs={'tags': 'good, great'})
self.assertItemsEqual(['5', '6'], [n.id for n in driver.list_nodes()])
- def test_destroy_node_destroys_disk(self):
- driver = self.new_driver()
- driver.destroy_node(testutil.cloud_node_mock())
- self.assertTrue(self.driver_mock().destroy_node.call_args[1].get(
- 'destroy_boot_disk'))
-
def build_gce_metadata(self, metadata_dict):
# Convert a plain metadata dictionary to the GCE data structure.
return {