Skip to content

Commit

Permalink
Merge pull request #462 from MichaelSasser/bugfix/#453-deprecate-jits…
Browse files Browse the repository at this point in the history
…i-subcommands

Add deprecation warning to jitsi subcommands
  • Loading branch information
MichaelSasser authored Dec 16, 2022
2 parents b469524 + 00f3358 commit 32b6613
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
13 changes: 8 additions & 5 deletions matrixctl/addons/adduser_jitsi/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

from __future__ import annotations

import logging

from argparse import Namespace

from matrixctl.handlers.ssh import SSH
Expand All @@ -31,6 +33,8 @@
__email__: str = "[email protected]"


logger = logging.getLogger(__name__)

JID_EXT: str = "matrix-jitsi-web"


Expand All @@ -50,13 +54,12 @@ def addon(arg: Namespace, yaml: YAML) -> int:
Non-zero value indicates error code, or zero on success.
"""
address = (
yaml.get("server", "ssh", "address")
if yaml.get("server", "ssh", "address")
else f"matrix.{yaml.get('server', 'api', 'domain')}"
logger.warning(
"[DEPRECATION WARNING] adduser-jitsi will be retired in version 0.13.0"
)

with SSH(
address,
yaml.get("server", "ssh", "address"),
yaml.get("server", "ssh", "user"),
yaml.get("server", "ssh", "port"),
) as ssh:
Expand Down
4 changes: 3 additions & 1 deletion matrixctl/addons/adduser_jitsi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def subparser_adduser_jitsi(subparsers: _SubParsersAction[t.Any]) -> None:
"""
parser: ArgumentParser = subparsers.add_parser(
"adduser-jitsi", help="Add users to a jitsi server"
"adduser-jitsi",
help="[DEPRECATED] Add users to a jitsi server",
description="This feature will be removed in MatrixCtl v0.13.0",
)
parser.add_argument("user", help="The Username of the new jitsi user")
parser.set_defaults(addon="adduser_jitsi")
Expand Down
15 changes: 10 additions & 5 deletions matrixctl/addons/deluser_jitsi/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

from __future__ import annotations

import logging

from argparse import Namespace

from matrixctl.handlers.ssh import SSH
Expand All @@ -29,6 +31,9 @@
__email__: str = "[email protected]"


logger = logging.getLogger(__name__)


JID_EXT: str = "matrix-jitsi-web"


Expand All @@ -50,13 +55,13 @@ def addon(arg: Namespace, yaml: YAML) -> int:
Non-zero value indicates error code, or zero on success.
"""
address = (
yaml.get("server", "ssh", "address")
if yaml.get("server", "ssh", "address")
else f"matrix.{yaml.get('server', 'api','domain')}"

logger.warning(
"[DEPRECATION WARNING] adduser-jitsi will be retired in version 0.13.0"
)

with SSH(
address,
yaml.get("server", "ssh", "address"),
yaml.get("server", "ssh", "user"),
yaml.get("server", "ssh", "port"),
) as ssh:
Expand Down
4 changes: 3 additions & 1 deletion matrixctl/addons/deluser_jitsi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def subparser_deluser_jitsi(subparsers: _SubParsersAction[t.Any]) -> None:
"""
parser: ArgumentParser = subparsers.add_parser(
"deluser-jitsi", help="Delete jitsi users"
"deluser-jitsi",
help="[DEPRECATED] Delete jitsi users",
description="This feature will be removed in MatrixCtl v0.13.0",
)
parser.add_argument(
"user", help="The jitsi username of the user to delete"
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions news/453.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a deprecation warning to the adduser-jitsi and deluser-jitsi commands. They are planned for removal in MatrixCtl v0.13.0.

0 comments on commit 32b6613

Please sign in to comment.