def _update(self, api_obj):
        """Copy state from api_obj to this object."""
        if not isinstance(self, api_obj.__class__):
            raise ex.CMApiValueError(
                _("Class %(class1)s does not derive from %(class2)s; "
                    "cannot update attributes.")
                % {'class1': self.__class__, 'class2': api_obj.__class__})

        for name in self._get_attributes().keys():
            try:
                val = getattr(api_obj, name)
                setattr(self, name, val)
            except __HOLE__:
                pass
dataset/ETHPy150Open openstack/sahara/sahara/plugins/cdh/client/types.py/BaseApiObject._update