Skip to content

Commit

Permalink
v7 model: Replace the device.should_be_running__release with is_pinne…
Browse files Browse the repository at this point in the history
…d_on__release

Change-type: major
  • Loading branch information
otaviojacobi committed Aug 29, 2024
1 parent 6b13288 commit 438bf2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions balena/models/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@ def is_tracking_application_release(self, uuid_or_id: Union[str, int]) -> bool:
bool: is tracking the current application release.
"""

return not bool(self.get(uuid_or_id, {"$select": "should_be_running__release"})["should_be_running__release"])
return not bool(self.get(uuid_or_id, {"$select": "is_pinned_on__release"})["is_pinned_on__release"])

# TODO: enable device batching
def pin_to_release(
Expand Down Expand Up @@ -1667,7 +1667,7 @@ def pin_to_release(
{
"resource": "device",
"id": device["id"],
"body": {"should_be_running__release": release["id"]},
"body": {"is_pinned_on__release": release["id"]},
}
)

Expand All @@ -1679,7 +1679,7 @@ def track_application_release(self, uuid_or_id_or_ids: Union[str, int, List[int]
uuid_or_id_or_ids (Union[str, int, List[int]]): device uuid (str) or id (int) or ids (List[int])
"""

self.__set(uuid_or_id_or_ids, {"should_be_running__release": None})
self.__set(uuid_or_id_or_ids, {"is_pinned_on__release": None})

# TODO: enable device batching
def set_supervisor_release(
Expand Down
2 changes: 1 addition & 1 deletion balena/types/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ class ReleaseType(TypedDict):
release_image: ReverseNavigationResource[ReleaseImageType]
should_be_running_on__application: ReverseNavigationResource[TypeApplication]
is_running_on__device: ReverseNavigationResource[TypeDevice]
should_be_running_on__device: ReverseNavigationResource[TypeDevice]
is_pinned_to__device: ReverseNavigationResource[TypeDevice]
should_operate__device: ReverseNavigationResource[TypeDevice]
release_tag: ReverseNavigationResource[BaseTagType]

Expand Down

0 comments on commit 438bf2a

Please sign in to comment.