def update_from_instance(self, usage, sign=1):
        """Update the resource information to reflect the allocation for
        an instance with the given resource usage.

        :param usage: the resource usage of the instance
        :param sign: has value 1 or -1. 1 indicates the instance is being
        added to the current usage, -1 indicates the instance is being removed.

        :returns: None
        """
        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