Skip to content

Commit b8e8534

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
sambacc/commands: makde the dc main command setup less special
Now that the main samba-container entrypoint is cleaned up, allow the dc script entry point to be a bit more like the regular commmands when set up. Signed-off-by: John Mulligan <[email protected]>
1 parent 4071924 commit b8e8534

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

sambacc/commands/addc.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from sambacc import smbconf_api
2727
from sambacc import smbconf_samba
2828

29-
from .cli import best_waiter, CommandBuilder, Context, Fail
29+
from .cli import Context, Fail, best_waiter, commands
3030

3131
try:
3232
import dns
@@ -43,10 +43,8 @@
4343
_populated: str = "/var/lib/samba/POPULATED"
4444
_provisioned: str = "/etc/samba/smb.conf"
4545

46-
dccommands = CommandBuilder()
4746

48-
49-
@dccommands.command(name="summary")
47+
@commands.command(name="summary")
5048
def summary(ctx: Context) -> None:
5149
print("Hello", ctx)
5250

@@ -192,7 +190,7 @@ def _prep_krb5_conf(ctx: Context) -> None:
192190
shutil.copy("/var/lib/samba/private/krb5.conf", "/etc/krb5.conf")
193191

194192

195-
@dccommands.command(name="run", arg_func=_run_container_args)
193+
@commands.command(name="run", arg_func=_run_container_args)
196194
def run(ctx: Context) -> None:
197195
_logger.info("Running AD DC container")
198196
if _dosetup(ctx, "wait-domain"):

sambacc/commands/dcmain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from . import addc
2222
from . import skips
23-
from .cli import Fail
23+
from .cli import Fail, commands
2424
from .common import (
2525
CommandContext,
2626
enable_logging,
@@ -34,7 +34,7 @@
3434

3535

3636
def main(args: typing.Optional[typing.Sequence[str]] = None) -> None:
37-
cli = addc.dccommands.assemble(arg_func=global_args).parse_args(args)
37+
cli = commands.assemble(arg_func=global_args).parse_args(args)
3838
env_to_cli(cli)
3939
enable_logging(cli)
4040
if not cli.identity:

0 commit comments

Comments
 (0)