57 lines
2.2 KiB
Diff
57 lines
2.2 KiB
Diff
|
--- azurelinuxagent/pa/deprovision/factory.py.orig
|
||
|
+++ azurelinuxagent/pa/deprovision/factory.py
|
||
|
@@ -22,6 +22,7 @@ from .arch import ArchDeprovisionHandler
|
||
|
from .clearlinux import ClearLinuxDeprovisionHandler
|
||
|
from .coreos import CoreOSDeprovisionHandler
|
||
|
from .default import DeprovisionHandler
|
||
|
+from .suse import SUSEDeprovisionHandler
|
||
|
from .ubuntu import UbuntuDeprovisionHandler, Ubuntu1804DeprovisionHandler
|
||
|
|
||
|
|
||
|
@@ -39,6 +40,8 @@ def get_deprovision_handler(distro_name=
|
||
|
return CoreOSDeprovisionHandler()
|
||
|
if "Clear Linux" in distro_full_name:
|
||
|
return ClearLinuxDeprovisionHandler() # pylint: disable=E1120
|
||
|
+ if distro_name in ("suse", "sle_hpc", "sles", "opensuse"):
|
||
|
+ return SUSEDeprovisionHandler()
|
||
|
|
||
|
return DeprovisionHandler()
|
||
|
|
||
|
--- /dev/null
|
||
|
+++ azurelinuxagent/pa/deprovision/suse.py
|
||
|
@@ -0,0 +1,34 @@
|
||
|
+# Microsoft Azure Linux Agent
|
||
|
+#
|
||
|
+# Copyright 2022 Microsoft Corporation
|
||
|
+#
|
||
|
+# Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
+# you may not use this file except in compliance with the License.
|
||
|
+# You may obtain a copy of the License at
|
||
|
+#
|
||
|
+# http://www.apache.org/licenses/LICENSE-2.0
|
||
|
+#
|
||
|
+# Unless required by applicable law or agreed to in writing, software
|
||
|
+# distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
+# See the License for the specific language governing permissions and
|
||
|
+# limitations under the License.
|
||
|
+#
|
||
|
+# Requires Python 2.6+ and Openssl 1.0+
|
||
|
+#
|
||
|
+
|
||
|
+import azurelinuxagent.common.utils.fileutil as fileutil
|
||
|
+from azurelinuxagent.pa.deprovision.default import DeprovisionHandler, \
|
||
|
+ DeprovisionAction
|
||
|
+
|
||
|
+class SUSEDeprovisionHandler(DeprovisionHandler):
|
||
|
+ def __init__(self):
|
||
|
+ super(SUSEDeprovisionHandler, self).__init__()
|
||
|
+
|
||
|
+ def reset_hostname(self, warnings, actions):
|
||
|
+ localhost = ["AUTO"]
|
||
|
+ actions.append(DeprovisionAction(self.osutil.set_hostname,
|
||
|
+ localhost))
|
||
|
+ actions.append(DeprovisionAction(self.osutil.set_dhcp_hostname,
|
||
|
+ localhost))
|
||
|
+
|