

def update_from_instance(self, usage, sign=1):
    'Update the resource information to reflect the allocation for\n        an instance with the given resource usage.\n\n        :param usage: the resource usage of the instance\n        :param sign: has value 1 or -1. 1 indicates the instance is being\n        added to the current usage, -1 indicates the instance is being removed.\n\n        :returns: None\n        '
    if (not self._mgr.extensions):
        return
    if (sign == 1):
        self._mgr.map_method('add_instance', usage)
    else:
        self._mgr.map_method('remove_instance', usage)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/compute/resources/__init__.py ResourceHandler.update_from_instance/original