|
16 | 16 |
|
17 | 17 | @click.command() |
18 | 18 | @click.option("-a", "--alias", help="Another account to assign username as an alias.") |
| 19 | +@click.option("-d", "--delete", "_delete", is_flag=True, help="Also delete the account.") |
19 | 20 | @click.option("-f", "--force", is_flag=True, help="Don't ask for confirmation.") |
20 | 21 | @click.option("-n", "--notify", help="An email address to send the new password notification.") |
21 | 22 | @click.argument("username") |
22 | 23 | @click.pass_context |
23 | | -def offboard(ctx: click.Context, username: str, alias: str = "", force: bool = False, **kwargs): |
24 | | - """Fully offboard a user from Compiler. |
25 | | -
|
26 | | - Args: |
27 | | - username (str): The user account to offboard. |
| 24 | +def offboard(ctx: click.Context, username: str, alias: str = "", _delete: bool = False, force: bool = False, **kwargs): |
| 25 | + """ |
| 26 | + Fully offboard a user from Compiler. |
28 | 27 |
|
29 | | - alias (str): [Optional] account to assign username as an alias |
30 | | - Returns: |
31 | | - A value indicating if the operation succeeded or failed. |
| 28 | + Deactivate, back up email, transfer Calendar/Drive, and optionally delete. |
32 | 29 | """ |
33 | 30 | account = user_account_name(username) |
34 | 31 |
|
@@ -65,11 +62,14 @@ def offboard(ctx: click.Context, username: str, alias: str = "", force: bool = F |
65 | 62 | CallGAMCommand(("show", "transfers", "olduser", username), stdout=stdout.name, stderr="stdout") |
66 | 63 | status = " ".join(stdout.readlines()) |
67 | 64 | stdout.seek(0) |
| 65 | + click.echo("Transfer complete") |
68 | 66 |
|
| 67 | + click.echo("Deprovisioning POP/IMAP") |
69 | 68 | CallGAMCommand(("user", account, "deprovision", "popimap")) |
70 | 69 |
|
71 | 70 | # call the delete command |
72 | | - ctx.forward(delete) |
| 71 | + if _delete: |
| 72 | + ctx.forward(delete) |
73 | 73 |
|
74 | 74 | if alias_account: |
75 | 75 | click.echo(f"Adding an alias to account: {alias_account}") |
|
0 commit comments