Skip to content

Commit 2706826

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
varlink: rename OperationNotSupported error argument
To be more consistent across all the objects and errors, rename "entry" to "name". It was always the name. When the API expects a whole entry object we should use "entry". "name" is a string. Signed-off-by: John Mulligan <[email protected]>
1 parent e4a3153 commit 2706826

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

sambacc/varlink/interfaces/org.samba.containers.keybridge.varlink

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ error ReadOnlyScope (name: string)
7373

7474
# OperationNotSupported may be returned if an entry method is not supported by
7575
# the given scope.
76-
error OperationNotSupported (op: string, entry: string, scope: string)
76+
error OperationNotSupported (op: string, name: string, scope: string)

sambacc/varlink/keybridge.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class OperationNotSupported(KeyBridgeError):
9797
"""
9898

9999
_name = "OperationNotSupported"
100-
_expect = {"op", "entry", "scope"}
100+
_expect = {"op", "name", "scope"}
101101

102102

103103
class OpKind(str, enum.Enum):
@@ -245,7 +245,7 @@ def _verify(
245245
)
246246
raise OperationNotSupported(
247247
op=op.value,
248-
entry=name,
248+
name=name,
249249
scope=scope_name,
250250
)
251251

@@ -316,7 +316,7 @@ def Set(self, entry: dict, _request: _Request) -> None:
316316
if not _set:
317317
raise OperationNotSupported(
318318
op=OpKind.SET.value,
319-
entry=_entry.name,
319+
name=_entry.name,
320320
scope=_entry.scope,
321321
)
322322
_set(_entry.name, _entry.kind, _entry.data)
@@ -335,7 +335,7 @@ def Delete(self, name: str, scope: str, _request: _Request) -> None:
335335
if not _delete:
336336
raise OperationNotSupported(
337337
op=OpKind.DELETE.value,
338-
entry=name,
338+
name=name,
339339
scope=scope,
340340
)
341341
_delete(name)
@@ -482,7 +482,7 @@ def set(self, key: str, kind: EntryKind, value: str) -> None:
482482
if not _set:
483483
raise OperationNotSupported(
484484
op=OpKind.SET.value,
485-
entry=key,
485+
name=key,
486486
scope=self.other.name(),
487487
)
488488
_set(key, kind, value)
@@ -492,7 +492,7 @@ def delete(self, key: str) -> None:
492492
if not _delete:
493493
raise OperationNotSupported(
494494
op=OpKind.DELETE.value,
495-
entry=key,
495+
name=key,
496496
scope=self.other.name(),
497497
)
498498
_delete(key)

0 commit comments

Comments
 (0)