xref: /aosp_15_r20/tools/acloud/hostcleanup/hostcleanup.py (revision 800a58d989c669b8eb8a71d8df53b1ba3d411444)
1# Copyright 2021 - The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14r"""Hostcleanup entry point.
15
16Hostcleanup will rollback acloud host setup steps.
17"""
18from acloud.hostcleanup import host_cleanup_runner
19
20def Run(args):
21    """Run Hostcleanup.
22
23    Hostcleanup options:
24        -cleanup_pkgs: Uninstall packages.
25
26    Args:
27        args: Namespace object from argparse.parse_args.
28    """
29    # TODO(b/145763747): Need to implement cleanup configs and usergroup.
30    if args.cleanup_pkgs:
31        host_cleanup_runner.PackagesUninstaller().Run()
32