1# Microsoft Azure Linux Agent
2#
3# Copyright 2018 Microsoft Corporation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# Requires Python 2.6+ and Openssl 1.0+
18#
19
20import azurelinuxagent.common.utils.fileutil as fileutil
21from azurelinuxagent.pa.deprovision.default import DeprovisionHandler, \
22                                                   DeprovisionAction
23
24class ArchDeprovisionHandler(DeprovisionHandler):
25    def __init__(self):  # pylint: disable=W0235
26        super(ArchDeprovisionHandler, self).__init__()
27
28    def setup(self, deluser):
29        warnings, actions = super(ArchDeprovisionHandler, self).setup(deluser)
30        warnings.append("WARNING! /etc/machine-id will be removed.")
31        files_to_del = ['/etc/machine-id']
32        actions.append(DeprovisionAction(fileutil.rm_files, files_to_del))
33        return warnings, actions
34