Skip to content

Commit 8d4be3d

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
commands: enable using a rados object uri for ctdb cluster meta
Add code to the ctdb related commands in sambacc to enable using a rados object as a cluster metatadata object. Signed-off-by: John Mulligan <[email protected]>
1 parent a05c4c8 commit 8d4be3d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sambacc/commands/ctdb.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525
from sambacc import ctdb
2626
from sambacc import jfile
27-
from sambacc.simple_waiter import Waiter
27+
from sambacc import rados_opener
28+
from sambacc.simple_waiter import Sleeper, Waiter
2829

2930
from .cli import best_waiter, commands, Context, Fail
3031

@@ -195,6 +196,12 @@ def _cluster_meta_init(self) -> None:
195196
# don't do file modes the way we need for JSON state file or do
196197
# writable file types in the url_opener (urllib wrapper). For now, just
197198
# manually handle the string.
199+
if rados_opener.is_rados_uri(uri):
200+
self._cluster_meta_obj = (
201+
rados_opener.ClusterMetaRADOSObject.create_from_uri(uri)
202+
)
203+
self._waiter_obj = Sleeper()
204+
return
198205
if uri.startswith("file:"):
199206
path = uri.split(":", 1)[-1]
200207
else:

0 commit comments

Comments
 (0)