def refresh(self, context=None): """Refresh the object by re-fetching from the DB. :param context: Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don't use it. A context should be set when instantiating the object, e.g.: Node(context) """ current = self.__class__.get_by_uuid(self._context, self.uuid) for field in self.fields: if (hasattr(self, base.get_attrname(field)) and self[field] != current[field]): self[field] = current[field]
def refresh(self, context=None): """Refresh the object by re-fetching from the DB. :param context: Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don't use it. A context should be set when instantiating the object, e.g.: Service(context) """ current = self.__class__.get_by_uuid(self._context, self.uuid) for field in self.fields: if (hasattr( self, base.get_attrname(field)) and self[field] != current[field]): self[field] = current[field]
def refresh(self, context=None): """Loads updates for this SessionWP. Loads a session with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded session column by column, if there are any updates. :param context: Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don't use it. A context should be set when instantiating the object, e.g.: SessionWP(context) """ current = self.__class__.get_by_uuid(self._context, uuid=self.uuid) for field in self.fields: if (hasattr(self, base.get_attrname(field)) and self[field] != current[field]): self[field] = current[field]
def refresh(self, context=None): """Loads and applies updates for this Conductor. Loads a :class:`Conductor` with the same uuid from the database and checks for updated attributes. :param context: Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don't use it. A context should be set when instantiating the object, e.g.: Conductor(context) """ current = self.__class__.get_by_hostname(self._context, hostname=self.hostname) for field in self.fields: if (hasattr(self, base.get_attrname(field)) and self[field] != current[field]): self[field] = current[field]
def refresh(self, context=None): """Loads updates for this SessionWP. Loads a session with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded session column by column, if there are any updates. :param context: Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don't use it. A context should be set when instantiating the object, e.g.: SessionWP(context) """ current = self.__class__.get_by_uuid(self._context, uuid=self.uuid) for field in self.fields: if (hasattr( self, base.get_attrname(field)) and self[field] != current[field]): self[field] = current[field]