def refresh(self, context): current = self.__class__.get_by_hostname(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): """Refresh the object by re-fetching from the DB. :param context: Security context. NOTE: This is only used internally by the indirection_api. """ 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): """Loads updates for this Port. Loads a port with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded port column by column, if there are any updates. :param context: Security context """ current = self.__class__.get_by_uuid(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): """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): """Loads and applies updates for this Chassis. Loads a :class:`Chassis` with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded chassis column by column, if there are any updates. :param context: Security context. NOTE: This is only used internally by the indirection_api. """ 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 updates for this Port. Loads a port with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded port 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.: Port(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 Chassis. Loads a :class:`Chassis` with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded chassis 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.: Chassis(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]