|
| 1 | +From 8a7fdf7f3e1194fa4674eea1d5442ca1660c0a67 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Aadhar Agarwal <aadagarwal@microsoft.com> |
| 3 | +Date: Tue, 19 Mar 2024 11:19:38 -0700 |
| 4 | +Subject: [PATCH] [Plugin,Policy] Make an AzurePlugin class, Update the vendor |
| 5 | + url, Update the check function |
| 6 | + |
| 7 | +Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com> |
| 8 | +--- |
| 9 | + sos/policies/distros/azure.py | 6 +++++- |
| 10 | + sos/report/plugins/__init__.py | 5 +++++ |
| 11 | + 2 files changed, 10 insertions(+), 1 deletion(-) |
| 12 | + |
| 13 | +diff --git a/sos/policies/distros/azure.py b/sos/policies/distros/azure.py |
| 14 | +index 950799fa83..b521d1e1be 100644 |
| 15 | +--- a/sos/policies/distros/azure.py |
| 16 | ++++ b/sos/policies/distros/azure.py |
| 17 | +@@ -8,6 +8,7 @@ |
| 18 | + # |
| 19 | + # See the LICENSE file in the source distribution for further information. |
| 20 | + |
| 21 | ++from sos.report.plugins import AzurePlugin |
| 22 | + from sos.policies.distros.redhat import RedHatPolicy, OS_RELEASE |
| 23 | + import os |
| 24 | + |
| 25 | +@@ -17,7 +18,7 @@ class AzurePolicy(RedHatPolicy): |
| 26 | + distro = "Azure Linux" |
| 27 | + vendor = "Microsoft" |
| 28 | + vendor_urls = [ |
| 29 | +- ('Distribution Website', 'https://github.com/microsoft/CBL-Mariner') |
| 30 | ++ ('Distribution Website', 'https://github.com/microsoft/azurelinux') |
| 31 | + ] |
| 32 | + |
| 33 | + def __init__(self, sysroot=None, init=None, probe_runtime=True, |
| 34 | +@@ -25,6 +26,7 @@ def __init__(self, sysroot=None, init=None, probe_runtime=True, |
| 35 | + super(AzurePolicy, self).__init__(sysroot=sysroot, init=init, |
| 36 | + probe_runtime=probe_runtime, |
| 37 | + remote_exec=remote_exec) |
| 38 | ++ self.valid_subclasses += [AzurePlugin] |
| 39 | + |
| 40 | + @classmethod |
| 41 | + def check(cls, remote=''): |
| 42 | +@@ -40,6 +42,8 @@ def check(cls, remote=''): |
| 43 | + if line.startswith('NAME'): |
| 44 | + if 'Common Base Linux Mariner' in line: |
| 45 | + return True |
| 46 | ++ if 'Microsoft Azure Linux' in line: |
| 47 | ++ return True |
| 48 | + return False |
| 49 | + |
| 50 | + # vim: set et ts=4 sw=4 : |
| 51 | +diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py |
| 52 | +index 94ee50d7fd..fc674be086 100644 |
| 53 | +--- a/sos/report/plugins/__init__.py |
| 54 | ++++ b/sos/report/plugins/__init__.py |
| 55 | +@@ -3621,6 +3621,11 @@ class SCLPlugin(RedHatPlugin): |
| 56 | + self.add_copy_spec(scl_copyspecs) |
| 57 | + |
| 58 | + |
| 59 | ++class AzurePlugin(PluginDistroTag): |
| 60 | ++ """Tagging class for Azure Linux""" |
| 61 | ++ pass |
| 62 | ++ |
| 63 | ++ |
| 64 | + def import_plugin(name, superclasses=None): |
| 65 | + """Import name as a module and return a list of all classes defined in that |
| 66 | + module. superclasses should be a tuple of valid superclasses to import, |
0 commit comments