|
3 | 3 | from __future__ import annotations |
4 | 4 |
|
5 | 5 | from pytest_mh import MultihostHost, MultihostUtility |
6 | | -from pytest_mh.cli import CLIBuilder, CLIBuilderArgs |
| 6 | +from pytest_mh.cli import CLIBuilder |
7 | 7 | from pytest_mh.conn import ProcessResult |
8 | 8 |
|
9 | 9 | __all__ = [ |
@@ -191,37 +191,33 @@ def renew( |
191 | 191 | command = ["realm", "renew", domain, "--verbose", *args] |
192 | 192 | return self.host.conn.exec(command) |
193 | 193 |
|
194 | | - def permit(self, user: str, *, withdraw: bool = False, args: list[str] | None = None) -> ProcessResult: |
| 194 | + def permit(self, *, args: list[str] | None = None) -> ProcessResult: |
195 | 195 | """ |
196 | | - Permit users log in. |
| 196 | + Permit and deny users, groups local log in. |
197 | 197 |
|
198 | | - :param user: User to permit. |
199 | | - :type user: str |
200 | | - :param withdraw: Withdraw permission, defaults to False |
201 | | - :type withdraw: bool, optional |
202 | 198 | :param args: Additional arguments, defaults to None |
203 | 199 | :type args: list[str] | None, optional |
204 | 200 | :return: Result of called command. |
205 | 201 | :rtype: ProcessResult |
206 | 202 | """ |
207 | | - cli_args: CLIBuilderArgs = {"withdraw": (self.cli.option.SWITCH, withdraw)} |
208 | 203 | if args is None: |
209 | 204 | args = [] |
210 | 205 |
|
211 | | - return self.host.conn.exec(["realm", "permit", *self.cli.args(cli_args), *args, user]) |
| 206 | + return self.host.conn.exec(["realm", "permit", *args]) |
212 | 207 |
|
213 | | - def deny(self, user: str, *, args: list[str] | None = None) -> ProcessResult: |
| 208 | + def deny(self, *, args: list[str] | None = None) -> ProcessResult: |
214 | 209 | """ |
215 | | - Deny users log in. |
| 210 | + Deny local log in. |
216 | 211 |
|
217 | | - :param user: User. |
218 | | - :type user: str |
219 | 212 | :param args: Additional arguments, defaults to None |
220 | 213 | :type args: list[str] | None, optional |
221 | 214 | :return: Result of called command. |
222 | 215 | :rtype: ProcessResult |
223 | 216 | """ |
224 | | - return self.permit(user, withdraw=True, args=args) |
| 217 | + if args is None: |
| 218 | + args = [] |
| 219 | + |
| 220 | + return self.host.conn.exec(["realm", "deny", *args]) |
225 | 221 |
|
226 | 222 | def list(self, *, args: list[str] | None = None) -> ProcessResult: |
227 | 223 | """ |
|
0 commit comments