'Load the resource state from its DB representation.'

def _load_data(self, resource):

    self.resource_id = resource.physical_resource_id
    self.action = resource.action
    self.status = resource.status
    self.status_reason = resource.status_reason
    self.id = resource.id
    self.uuid = resource.uuid
    try:
        self._data = resource_data_objects.ResourceData.get_all(self, resource.data)
    except exception.NotFound:
        self._data = {}
    self.attributes.cached_attrs = (resource.attr_data or None)
    self._attr_data_id = resource.attr_data_id
    self._rsrc_metadata = resource.rsrc_metadata
    self._stored_properties_data = resource.properties_data
    self._rsrc_prop_data = resource.rsrc_prop_data
    self.created_time = resource.created_at
    self.updated_time = resource.updated_at
    self.needed_by = resource.needed_by
    self.requires = resource.requires
    self.replaces = resource.replaces
    self.replaced_by = resource.replaced_by
    self.current_template_id = resource.current_template_id
    self.root_stack_id = resource.root_stack_id
    self._atomic_key = resource.atomic_key
