Skip to content

Commit

Permalink
Logging hardware.save()
Browse files Browse the repository at this point in the history
  • Loading branch information
Soufiane Jounaid committed Dec 21, 2023
1 parent 9efe323 commit 4df1787
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doni/objects/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
from doni.objects import base
from doni.objects import fields as object_fields

from oslo_log import log

if TYPE_CHECKING:
from doni.common.context import RequestContext
from doni.worker import WorkerState


LOG = log.getLogger(__name__)
@base.DoniObjectRegistry.register
class Hardware(base.DoniObject):
# Version 1.0: Initial version
Expand Down Expand Up @@ -61,6 +63,7 @@ def save(self, context: "RequestContext" = None):
HardwareNotFound: if the hardware does not exist.
"""
updates = self.obj_get_changes()
LOG.info(f"(hardware.save) CHANGES TO OBJECT '{updates}'")
db_hardware = self.dbapi.update_hardware(self.uuid, updates)
self._from_db_object(self._context, self, db_hardware)

Expand Down

0 comments on commit 4df1787

Please sign in to comment.