Skip to content

Commit

Permalink
fixed resource types for computing addons
Browse files Browse the repository at this point in the history
  • Loading branch information
opaduchak committed Dec 17, 2024
1 parent 7b777fd commit 892e3bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions osf/external/gravy_valet/translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
class AddonType(enum.StrEnum):
STORAGE = enum.auto()
CITATION = enum.auto()
# TODO: fully support compute addons
#REMOTE_COMPUTE = enum.auto()
COMPUTING = enum.auto()

class _LegacyConfigsForWBKey(enum.Enum):
"""Mapping from a GV ExternalStorageService's waterbutler key to the legacy Addon config."""
Expand Down
10 changes: 5 additions & 5 deletions osf_tests/external/gravy_valet/gv_fakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class _FakeStorageAccount(_FakeGVEntity):
display_name: str = ''
external_storage_service: _FakeAddonProvider | None = None
external_citation_service: _FakeCitationAddonProvider | None = None
external_remote_compute_service: _FakeRemoteComputeAddonProvider | None = None
external_computing_service: _FakeRemoteComputeAddonProvider | None = None

@property
@cache
Expand Down Expand Up @@ -220,7 +220,7 @@ class _FakeCitationAccount(_FakeStorageAccount):

@dataclasses.dataclass(frozen=True)
class _FakeRemoteComputeAccount(_FakeStorageAccount):
RESOURCE_TYPE = 'authorized-remote_compute-accounts'
RESOURCE_TYPE = 'authorized-computing-accounts'


@dataclasses.dataclass(frozen=True)
Expand Down Expand Up @@ -276,7 +276,7 @@ class _FakeCitationAddon(_FakeStorageAddon):

@dataclasses.dataclass(frozen=True)
class _FakeRemoteComputeAddon(_FakeStorageAddon):
RESOURCE_TYPE = 'configured-remote_compute-addons'
RESOURCE_TYPE = 'configured-computing-addons'

class FakeGravyValet:
ROUTES = {
Expand Down Expand Up @@ -376,7 +376,7 @@ def configure_fake_account(
elif isinstance(connected_provider, _FakeAddonProvider):
account_type = 'storage'
elif isinstance(connected_provider, _FakeRemoteComputeAddonProvider):
account_type = 'remote_compute'
account_type = 'computing'
else:
raise Exception('unknown addon provider type')

Expand Down Expand Up @@ -774,4 +774,4 @@ def _validate_resource_access(requested_resource_uri, headers):
class _AccountTypes(Enum):
storage = _FakeStorageAccount
citation = _FakeCitationAccount
remote_compute = _FakeRemoteComputeAccount
computing = _FakeRemoteComputeAccount

0 comments on commit 892e3bb

Please sign in to comment.