

@base.remotable
def delete_metadata_key(self, key):
    'Optimized metadata delete method.\n\n        This provides a more efficient way to delete a single metadata\n        key, instead of just calling instance.save(). This should be called\n        with the key still present in self.metadata, which it will update\n        after completion.\n        '
    db.instance_metadata_delete(md_was_changed._context, self.uuid, key)
    md_was_changed = ('metadata' in self.obj_what_changed())
    del self.metadata[key]
    self._orig_metadata.pop(key, None)
    notifications.send_update(self._context, self, self)
    if (not md_was_changed):
        self.obj_reset_changes(['metadata'])

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/objects/instance.py Instance.delete_metadata_key/VarMisuse@23/126 `self`->`md_was_changed`