You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.6 KiB
56 lines
1.6 KiB
3 days ago
|
From a9de62e64652cfb3d92352b70da8bcd6df7b1b80 Mon Sep 17 00:00:00 2001
|
||
|
From: Eugene Zamriy <eugene@zamriy.info>
|
||
|
Date: Sat, 1 Apr 2023 00:38:19 +0300
|
||
|
Subject: [PATCH] Add MSVSphere policy implementation
|
||
|
|
||
|
---
|
||
|
sos/policies/distros/msvsphere.py | 36 +++++++++++++++++++++++++++++++
|
||
|
1 file changed, 36 insertions(+)
|
||
|
create mode 100644 sos/policies/distros/msvsphere.py
|
||
|
|
||
|
diff --git a/sos/policies/distros/msvsphere.py b/sos/policies/distros/msvsphere.py
|
||
|
new file mode 100644
|
||
|
index 0000000..41ae374
|
||
|
--- /dev/null
|
||
|
+++ b/sos/policies/distros/msvsphere.py
|
||
|
@@ -0,0 +1,36 @@
|
||
|
+# Copyright (C) Eugene Zamriy <ezamriy@msvsphere.ru>
|
||
|
+
|
||
|
+# This file is part of the sos project: https://github.com/sosreport/sos
|
||
|
+#
|
||
|
+# This copyrighted material is made available to anyone wishing to use,
|
||
|
+# modify, copy, or redistribute it subject to the terms and conditions of
|
||
|
+# version 2 of the GNU General Public License.
|
||
|
+#
|
||
|
+# See the LICENSE file in the source distribution for further information.
|
||
|
+
|
||
|
+from sos.policies.distros.redhat import RedHatPolicy, OS_RELEASE
|
||
|
+import os
|
||
|
+
|
||
|
+
|
||
|
+class MSVSpherePolicy(RedHatPolicy):
|
||
|
+
|
||
|
+ distro = 'MSVSphere'
|
||
|
+
|
||
|
+ vendor = 'LLC "NCSD"'
|
||
|
+
|
||
|
+ vendor_urls = [
|
||
|
+ ('Distribution Website', 'https://msvsphere-os.ru'),
|
||
|
+ ('Vendor Website', 'http://ncpr.su/')
|
||
|
+ ]
|
||
|
+
|
||
|
+ @classmethod
|
||
|
+ def check(cls, remote=''):
|
||
|
+ if remote:
|
||
|
+ return cls.distro in remote
|
||
|
+ elif not os.path.exists(OS_RELEASE):
|
||
|
+ return False
|
||
|
+ with open(OS_RELEASE, 'r') as fd:
|
||
|
+ for line in fd:
|
||
|
+ if line.startswith('NAME') and 'MSVSphere' in line:
|
||
|
+ return True
|
||
|
+ return False
|
||
|
--
|
||
|
2.43.5
|
||
|
|