def destroy(self): """Insure only destroyable nodes are destroyed""" node = self.node if not config.is_node_destroyable(node.name): logger.error('node %s has non-destroyable prefix' % node.name) return False logger.info('destroying node %s' % node) return node.destroy()
def test_destroyable(self): assert config.is_node_destroyable('deploy-test-123', self.destroyable_prefixes) assert config.is_node_destroyable('demo-123', self.destroyable_prefixes)
def test_not_destroyable(self): assert not config.is_node_destroyable('trac-server', self.destroyable_prefixes) assert not config.is_node_destroyable('demo', self.destroyable_prefixes)