Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package sca-patterns-sle12 for 
openSUSE:Factory checked in at 2021-09-09 23:07:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/sca-patterns-sle12 (Old)
 and      /work/SRC/openSUSE:Factory/.sca-patterns-sle12.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "sca-patterns-sle12"

Thu Sep  9 23:07:29 2021 rev:25 rq:917631 version:1.0.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/sca-patterns-sle12/sca-patterns-sle12.changes    
2021-08-26 23:16:15.720201241 +0200
+++ 
/work/SRC/openSUSE:Factory/.sca-patterns-sle12.new.1899/sca-patterns-sle12.changes
  2021-09-09 23:07:52.404853885 +0200
@@ -1,0 +2,16 @@
+Tue Sep  7 22:02:06 UTC 2021 - Jason Record <jason.rec...@suse.com>
+
+- Updates to version 1.0.8
+  + Removed outdated TID2 link in bhc-diskused-00001.pl (bsc#1190260)
+  + Added Video link to coredumpctl-000018634.py
+  + Updated renewal link in bhc-scc-expired.py
+  + Updated registration link in bhc-scc-registered.py
+
+-------------------------------------------------------------------
+Fri Aug 27 13:41:02 UTC 2021 - Jason Record <jason.rec...@suse.com>
+
+- Renamed patterns for file standard
+  + renamed: patterns/SLE/sle12all/scc-expired.py -> 
patterns/SLE/sle12all/bhc-scc-expired.py
+  + renamed: patterns/SLE/sle12all/scc-registered.py -> 
patterns/SLE/sle12all/bhc-scc-registered.py
+
+-------------------------------------------------------------------

Old:
----
  sca-patterns-sle12-1.0.7.tar.gz

New:
----
  sca-patterns-sle12-1.0.8.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sca-patterns-sle12.spec ++++++
--- /var/tmp/diff_new_pack.laOSdc/_old  2021-09-09 23:07:52.972854543 +0200
+++ /var/tmp/diff_new_pack.laOSdc/_new  2021-09-09 23:07:52.976854548 +0200
@@ -25,7 +25,7 @@
 %define category SLE
 
 Name:           sca-patterns-sle12
-Version:        1.0.7
+Version:        1.0.8
 Release:        0
 Summary:        Supportconfig Analysis Patterns for SLE12
 License:        GPL-2.0-only

++++++ sca-patterns-sle12-1.0.7.tar.gz -> sca-patterns-sle12-1.0.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/bhc-diskused-00001.pl 
new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/bhc-diskused-00001.pl
--- old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/bhc-diskused-00001.pl    
2021-03-01 22:55:34.417828881 +0100
+++ new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/bhc-diskused-00001.pl    
2021-09-07 16:45:38.011053002 +0200
@@ -2,10 +2,10 @@
 
 # Title:       Basic Health Check - File System Used Space
 # Description: Check the available of mounted disk space
-# Modified:    2013 Jun 20
+# Modified:    2021 Sep 07
 
 ##############################################################################
-#  Copyright (C) 2013 SUSE LLC
+#  Copyright (C) 2013,2021 SUSE LLC
 ##############################################################################
 #
 #  This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
 #  along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 #  Authors/Contributors:
-#     Jason Record (jrec...@suse.com) - original BASH script
+#     Jason Record <jason.rec...@suse.com>
 #
 ##############################################################################
 
@@ -54,8 +54,7 @@
        PROPERTY_NAME_PRIMARY_LINK."=META_LINK_TID",
        PROPERTY_NAME_OVERALL."=$GSTATUS",
        PROPERTY_NAME_OVERALL_INFO."=None",
-       "META_LINK_TID=http://www.suse.com/support/kb/doc.php?id=7002723";,
-       "META_LINK_TID2=http://www.suse.com/support/kb/doc.php?id=3005720";
+       "META_LINK_TID=http://www.suse.com/support/kb/doc.php?id=7002723";
 );
 
 ##############################################################################
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/bhc-scc-expired.py 
new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/bhc-scc-expired.py
--- old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/bhc-scc-expired.py       
1970-01-01 01:00:00.000000000 +0100
+++ new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/bhc-scc-expired.py       
2021-09-07 23:56:15.714680374 +0200
@@ -0,0 +1,101 @@
+#!/usr/bin/python
+
+# Title:       Expired SCC Registrations
+# Description: Identify if SCC registrations have expired
+# Modified:    2021 Sep 07
+#
+##############################################################################
+# Copyright (C) 2015,2021 SUSE LLC
+##############################################################################
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+#  Authors/Contributors:
+#   Jason Record <jason.rec...@suse.com>
+#
+##############################################################################
+
+##############################################################################
+# Module Definition
+##############################################################################
+
+import os
+import Core
+import SUSE
+import datetime
+
+##############################################################################
+# Overriden (eventually or in part) from Core.py Module
+##############################################################################
+
+META_CLASS = "Basic Health"
+META_CATEGORY = "SLE"
+META_COMPONENT = "Registration"
+PATTERN_ID = os.path.basename(__file__)
+PRIMARY_LINK = "META_LINK_SCC"
+OVERALL = Core.TEMP
+OVERALL_INFO = "NOT SET"
+OTHER_LINKS = 
"META_LINK_SCC=https://scc.suse.com/dashboard|META_LINK_Renew=https://www.suse.com/renewals/";
+
+Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, 
OVERALL, OVERALL_INFO, OTHER_LINKS)
+
+##############################################################################
+# Main Program Execution
+##############################################################################
+
+SCC_INFO = SUSE.getSCCInfo()
+REG_EXPIRED = []
+REG_EXPIRING = []
+REG_VALID = []
+WARNING_DAYS = 60
+EXPIRE_DATE_FOUND = False
+TODAY = datetime.datetime.today()
+if( SCC_INFO ):
+       for PRODUCT in SCC_INFO:
+               #print "PRODUCT:    " + str(PRODUCT)
+               EXPIRE_DATE = ''
+               EXPIRE_STR = ''
+               if 'expires_at' in PRODUCT:
+                       EXPIRE_DATE_FOUND = True
+                       TMP = PRODUCT['expires_at'].split()
+                       del TMP[-1]
+                       EXPIRE_DATE = TMP[0]
+                       EXPIRE_STR = ' '.join(TMP)
+                       EXPIRATION = datetime.datetime.strptime(EXPIRE_STR, 
"%Y-%m-%d %H:%M:%S")
+                       EXPIRATION_WARNING = EXPIRATION - 
datetime.timedelta(days=int(WARNING_DAYS))
+               if( EXPIRE_STR ):
+                       if( TODAY > EXPIRATION ):
+                               REG_EXPIRED.append(str(PRODUCT['identifier']) + 
" " + str(PRODUCT['version']) + ": " + str(EXPIRE_DATE))
+                       elif( TODAY > EXPIRATION_WARNING ):
+                               REG_EXPIRING.append(str(PRODUCT['identifier']) 
+ " " + str(PRODUCT['version']) + ": " + str(EXPIRE_DATE))
+                       else:
+                               REG_VALID.append(str(PRODUCT['identifier']) + " 
" + str(PRODUCT['version']) + ": " + str(EXPIRE_DATE))
+
+       if( EXPIRE_DATE_FOUND ):
+               if( REG_EXPIRED ):
+                       if( REG_EXPIRING ):
+                               Core.updateStatus(Core.CRIT, "Detected expired 
product registrations: " + ' '.join(REG_EXPIRED) + "; expiring within " + 
str(WARNING_DAYS) + " days: " + ' '.join(REG_EXPIRING))
+                       else:
+                               Core.updateStatus(Core.CRIT, "Detected expired 
product registrations: " + ' '.join(REG_EXPIRED))
+               elif( REG_EXPIRING ):
+                               Core.updateStatus(Core.WARN, "Detected product 
registrations expiring within " + str(WARNING_DAYS) + " days: " + ' 
'.join(REG_EXPIRING))
+               else:
+                       Core.updateStatus(Core.SUCC, "No product registrations 
have expired or will expire within " + str(WARNING_DAYS) + " days, " + ' 
'.join(REG_VALID))
+       else:
+               Core.updateStatus(Core.ERROR, "SCC Status: No expire dates 
found")
+else:
+       Core.updateStatus(Core.ERROR, "SCC Status: Not Found")
+
+Core.printPatternResults()
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/bhc-scc-registered.py 
new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/bhc-scc-registered.py
--- old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/bhc-scc-registered.py    
1970-01-01 01:00:00.000000000 +0100
+++ new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/bhc-scc-registered.py    
2021-09-08 00:01:30.982590436 +0200
@@ -0,0 +1,183 @@
+#!/usr/bin/python
+#
+# Title:       Pattern for TID000018546
+# Description: Check system registration status
+# Source:      Basic Python Pattern Template v0.3.4
+# Options:     Basic 
Health,Registration,Status,registration-scc,000018546,0,2,0,0
+# Distro:      SLES1[2,5] All
+# Modified:    2021 Sep 07
+#
+##############################################################################
+# Copyright (C) 2021 SUSE LLC
+##############################################################################
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+#  Authors/Contributors:
+#   Jason Record <jason.rec...@suse.com>
+#
+##############################################################################
+
+import re
+import os
+import Core
+import SUSE
+
+META_CLASS = "Basic Health"
+META_CATEGORY = "SLE"
+META_COMPONENT = "Registration"
+PATTERN_ID = os.path.basename(__file__)
+PRIMARY_LINK = "META_LINK_TID"
+OVERALL = Core.TEMP
+OVERALL_INFO = "NOT SET"
+OTHER_LINKS = 
"META_LINK_TID=https://www.suse.com/support/kb/doc/?id=000018546|META_LINK_SCC=https://scc.suse.com/dashboard|META_LINK_Register=https://www.suse.com/support/";
+Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, 
OVERALL, OVERALL_INFO, OTHER_LINKS)
+
+OES_TAG = 'Microfocus'
+
+##############################################################################
+# Local Function Definitions
+##############################################################################
+
+def getRegService():
+       global OES_TAG
+       fileOpen = "updates.txt"
+       content = []
+       IDX_NUM = 0
+       IDX_ALIAS = 1
+       SERVICE_TAG = ''
+       SMT = re.compile("SMT-.*suse", re.IGNORECASE)
+       SUSE = re.compile("/updates.suse.com/|/scc.suse.com/", re.IGNORECASE)
+       OES = re.compile("/nu.novell.com/", re.IGNORECASE)
+       if Core.isFileActive(fileOpen):
+               section = "zypper --non-interactive --no-gpg-checks repos -d"
+               if Core.getRegExSection(fileOpen, "zypper --non-interactive 
--no-gpg-checks repos -d", content):
+                       IDX_URI = 8
+                       for line in content:
+                               PARTS = line.split('|')
+                               PARTS = [x.strip(' ') for x in PARTS]
+                               if( PARTS[IDX_NUM].isdigit() ):
+                                       REPO_ALIAS = PARTS[IDX_ALIAS].strip()
+                                       REPO_URI = PARTS[IDX_URI].strip()
+                                       if SUSE.search(PARTS[IDX_URI]):
+                                               SERVICE_TAG = 'SCC'
+                                       elif( 
PARTS[IDX_ALIAS].startswith('susemanager:') ):
+                                               SERVICE_TAG = 'SUMA'
+                                       elif( 
PARTS[IDX_ALIAS].startswith('spacewalk:') ):
+                                               SERVICE_TAG = 'SUMA'
+                                       elif SMT.search(PARTS[IDX_ALIAS]):
+                                               SERVICE_TAG = 'SMT'
+                                       elif OES.search(PARTS[IDX_URI]):
+                                               SERVICE_TAG = OES_TAG
+#                                      print(str(len(PARTS)) + ":" + 
str(SERVICE_TAG) + ": " + str(REPO_NUM) + '|' + str(REPO_ALIAS) + '\n  ' + 
str(REPO_URI))
+#                                      print(PARTS)
+               elif Core.getRegExSection(fileOpen, "zypper --non-interactive 
--no-gpg-checks repos -u", content):
+                       IDX_URI = 6
+                       for line in content:
+                               PARTS = line.split('|')
+                               PARTS = [x.strip(' ') for x in PARTS]
+                               if( PARTS[IDX_NUM].isdigit() ):
+                                       REPO_ALIAS = PARTS[IDX_ALIAS].strip()
+                                       REPO_URI = PARTS[IDX_URI].strip()
+                                       if SUSE.search(PARTS[IDX_URI]):
+                                               SERVICE_TAG = 'SCC'
+                                       elif( 
PARTS[IDX_ALIAS].startswith('susemanager:') ):
+                                               SERVICE_TAG = 'SUMA'
+                                       elif( 
PARTS[IDX_ALIAS].startswith('spacewalk:') ):
+                                               SERVICE_TAG = 'SUMA'
+                                       elif SMT.search(PARTS[IDX_ALIAS]):
+                                               SERVICE_TAG = 'SMT'
+                                       elif OES.search(PARTS[IDX_URI]):
+                                               SERVICE_TAG = OES_TAG
+#                                      print(str(len(PARTS)) + ":" + 
str(SERVICE_TAG) + ": " + str(REPO_NUM) + '|' + str(REPO_ALIAS) + '\n  ' + 
str(REPO_URI))
+#                                      print(PARTS)
+       return SERVICE_TAG
+
+def foundCredentials():
+       FILE_OPEN = "updates.txt"
+       CONTENT = []
+       IN_STATE = False
+       if Core.loadFullFile(FILE_OPEN, CONTENT):
+               for LINE in CONTENT:
+                       if( IN_STATE ):
+#                              print(LINE)
+                               if LINE.startswith('#==['):
+                                       IN_STATE = False
+#                                      print(' OUT_STATE')
+                               elif LINE.startswith('username='):
+                                       return True
+                       elif LINE.startswith('# /etc/zypp/credentials.d/'):
+#                              print('IN_STATE')
+                               IN_STATE = True
+
+       return False
+
+
+##############################################################################
+# Main Program Execution
+##############################################################################
+
+REG_LIST = []
+REG_ACTIVE = []
+REG_NOREG = []
+SCC_INFO = SUSE.getSCCInfo()
+REG_SERVICE = getRegService()
+REG_AUTH = foundCredentials()
+#print(REG_AUTH)
+if( SCC_INFO ):
+       for I in range(len(SCC_INFO)):
+               if( SCC_INFO[I]['status'] ):
+                       if( SCC_INFO[I]['status'].lower() == "registered" ):
+                               REG_LIST.append(SCC_INFO[I]['identifier'])
+                       elif( SCC_INFO[I]['status'].lower() == "not registered" 
):
+                               REG_NOREG.append(SCC_INFO[I]['identifier'])
+                       if 'subscription_status' in SCC_INFO[I]:
+                               if( SCC_INFO[I]['subscription_status'].lower() 
== "active" ):
+                                       
REG_ACTIVE.append(SCC_INFO[I]['identifier'])
+#              print(str(SCC_INFO[I]['identifier']) + ": " + 
str(SCC_INFO[I]['status']))
+#              print(SCC_INFO[I])
+#      print("\n")
+       if( len(REG_ACTIVE) > 0 ):
+               Core.updateStatus(Core.SUCC, "System Registered through " + 
str(REG_SERVICE) + ": " + ' '.join(REG_LIST))
+       elif( len(REG_LIST) > 0 ):
+               if( len(REG_SERVICE) > 0 ):
+                       Core.updateStatus(Core.SUCC, "System Remotely 
Registered through " + str(REG_SERVICE) + ": " + ' '.join(REG_LIST))
+               else:
+                       Core.updateStatus(Core.SUCC, "System Remotely 
Registered: " + ' '.join(REG_LIST))
+       elif( len(REG_NOREG) > 0 ):
+               if( len(REG_SERVICE) > 0 ):
+                       if( REG_AUTH ):
+                               Core.updateStatus(Core.SUCC, "System Remotely 
Registered through " + str(REG_SERVICE) + ": " + ' '.join(REG_NOREG))
+                       else:
+                               Core.updateStatus(Core.WARN, "Validate Remote 
Registration through " + str(REG_SERVICE) + ", missing credentials: " + ' 
'.join(REG_NOREG))
+               else:
+                       if( REG_AUTH ):
+                               Core.updateStatus(Core.WARN, "Invalid System 
Registration, Found credentials but no registration server")
+                       else:
+                               Core.updateStatus(Core.CRIT, "System Not 
Registered and Unsupported")
+       else:
+               Core.updateStatus(Core.WARN, "Validate System Registration")
+else:
+       if( len(REG_SERVICE) > 0 ):
+               if( REG_AUTH ):
+                       if( REG_SERVICE == OES_TAG ):
+                               Core.updateStatus(Core.WARN, "System Registered 
through " + str(REG_SERVICE) + ", Secondary Support Only")
+                       else:
+                               Core.updateStatus(Core.SUCC, "System Registered 
through " + str(REG_SERVICE))
+               else:
+                       Core.updateStatus(Core.CRIT, "System Not Registered and 
Unsupported - No Credentials")
+       else:
+               Core.updateStatus(Core.CRIT, "System Not Registered and 
Unsupported")
+
+Core.printPatternResults()
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/coredumpctl-000018634.py 
new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/coredumpctl-000018634.py
--- old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/coredumpctl-000018634.py 
2021-05-24 16:36:02.423157388 +0200
+++ new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/coredumpctl-000018634.py 
2021-09-07 17:38:30.999334358 +0200
@@ -4,7 +4,7 @@
 # Description: How to obtain systemd service core dumps
 # Source:      Basic Python Pattern Template v0.3.4
 # Options:     SLE,Application,Core,coredumpctl,000018634,0,1,0,0
-# Modified:    2021 May 24
+# Modified:    2021 Sep 07
 #
 ##############################################################################
 # Copyright (C) 2021 SUSE LLC
@@ -38,7 +38,7 @@
 PRIMARY_LINK = "META_LINK_TID"
 OVERALL = Core.TEMP
 OVERALL_INFO = "NOT SET"
-OTHER_LINKS = "META_LINK_TID=https://www.suse.com/support/kb/doc/?id=000018634";
+OTHER_LINKS = 
"META_LINK_TID=https://www.suse.com/support/kb/doc/?id=000018634|Video=https://youtu.be/CNsuBBh3M10";
 Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, 
OVERALL, OVERALL_INFO, OTHER_LINKS)
 
 CORE_LIST = {}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/scc-expired.py 
new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/scc-expired.py
--- old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/scc-expired.py   
2021-07-27 23:15:44.546069826 +0200
+++ new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/scc-expired.py   
1970-01-01 01:00:00.000000000 +0100
@@ -1,101 +0,0 @@
-#!/usr/bin/python
-
-# Title:       Expired SCC Registrations
-# Description: Identify if SCC registrations have expired
-# Modified:    2015 May 07
-#
-##############################################################################
-# Copyright (C) 2015 SUSE LLC
-##############################################################################
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-#  Authors/Contributors:
-#   Jason Record (jrec...@suse.com)
-#
-##############################################################################
-
-##############################################################################
-# Module Definition
-##############################################################################
-
-import os
-import Core
-import SUSE
-import datetime
-
-##############################################################################
-# Overriden (eventually or in part) from Core.py Module
-##############################################################################
-
-META_CLASS = "Basic Health"
-META_CATEGORY = "SLE"
-META_COMPONENT = "Registration"
-PATTERN_ID = os.path.basename(__file__)
-PRIMARY_LINK = "META_LINK_SCC"
-OVERALL = Core.TEMP
-OVERALL_INFO = "NOT SET"
-OTHER_LINKS = 
"META_LINK_SCC=https://scc.suse.com/dashboard|META_LINK_Renew=https://www.suse.com/products/server/how-to-buy/";
-
-Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, 
OVERALL, OVERALL_INFO, OTHER_LINKS)
-
-##############################################################################
-# Main Program Execution
-##############################################################################
-
-SCC_INFO = SUSE.getSCCInfo()
-REG_EXPIRED = []
-REG_EXPIRING = []
-REG_VALID = []
-WARNING_DAYS = 60
-EXPIRE_DATE_FOUND = False
-TODAY = datetime.datetime.today()
-if( SCC_INFO ):
-       for PRODUCT in SCC_INFO:
-               #print "PRODUCT:    " + str(PRODUCT)
-               EXPIRE_DATE = ''
-               EXPIRE_STR = ''
-               if 'expires_at' in PRODUCT:
-                       EXPIRE_DATE_FOUND = True
-                       TMP = PRODUCT['expires_at'].split()
-                       del TMP[-1]
-                       EXPIRE_DATE = TMP[0]
-                       EXPIRE_STR = ' '.join(TMP)
-                       EXPIRATION = datetime.datetime.strptime(EXPIRE_STR, 
"%Y-%m-%d %H:%M:%S")
-                       EXPIRATION_WARNING = EXPIRATION - 
datetime.timedelta(days=int(WARNING_DAYS))
-               if( EXPIRE_STR ):
-                       if( TODAY > EXPIRATION ):
-                               REG_EXPIRED.append(str(PRODUCT['identifier']) + 
" " + str(PRODUCT['version']) + ": " + str(EXPIRE_DATE))
-                       elif( TODAY > EXPIRATION_WARNING ):
-                               REG_EXPIRING.append(str(PRODUCT['identifier']) 
+ " " + str(PRODUCT['version']) + ": " + str(EXPIRE_DATE))
-                       else:
-                               REG_VALID.append(str(PRODUCT['identifier']) + " 
" + str(PRODUCT['version']) + ": " + str(EXPIRE_DATE))
-
-       if( EXPIRE_DATE_FOUND ):
-               if( REG_EXPIRED ):
-                       if( REG_EXPIRING ):
-                               Core.updateStatus(Core.CRIT, "Detected expired 
product registrations: " + ' '.join(REG_EXPIRED) + "; expiring within " + 
str(WARNING_DAYS) + " days: " + ' '.join(REG_EXPIRING))
-                       else:
-                               Core.updateStatus(Core.CRIT, "Detected expired 
product registrations: " + ' '.join(REG_EXPIRED))
-               elif( REG_EXPIRING ):
-                               Core.updateStatus(Core.WARN, "Detected product 
registrations expiring within " + str(WARNING_DAYS) + " days: " + ' 
'.join(REG_EXPIRING))
-               else:
-                       Core.updateStatus(Core.SUCC, "No product registrations 
have expired or will expire within " + str(WARNING_DAYS) + " days, " + ' 
'.join(REG_VALID))
-       else:
-               Core.updateStatus(Core.ERROR, "SCC Status: No expire dates 
found")
-else:
-       Core.updateStatus(Core.ERROR, "SCC Status: Not Found")
-
-Core.printPatternResults()
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/scc-registered.py 
new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/scc-registered.py
--- old/sca-patterns-sle12-1.0.7/patterns/SLE/sle12all/scc-registered.py        
2021-08-26 00:58:09.614684610 +0200
+++ new/sca-patterns-sle12-1.0.8/patterns/SLE/sle12all/scc-registered.py        
1970-01-01 01:00:00.000000000 +0100
@@ -1,183 +0,0 @@
-#!/usr/bin/python
-#
-# Title:       Pattern for TID000018546
-# Description: Check system registration status
-# Source:      Basic Python Pattern Template v0.3.4
-# Options:     Basic 
Health,Registration,Status,registration-scc,000018546,0,2,0,0
-# Distro:      SLES1[2,5] All
-# Modified:    2021 Aug 25
-#
-##############################################################################
-# Copyright (C) 2021 SUSE LLC
-##############################################################################
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-#  Authors/Contributors:
-#   Jason Record <jason.rec...@suse.com>
-#
-##############################################################################
-
-import re
-import os
-import Core
-import SUSE
-
-META_CLASS = "Basic Health"
-META_CATEGORY = "SLE"
-META_COMPONENT = "Registration"
-PATTERN_ID = os.path.basename(__file__)
-PRIMARY_LINK = "META_LINK_TID"
-OVERALL = Core.TEMP
-OVERALL_INFO = "NOT SET"
-OTHER_LINKS = 
"META_LINK_TID=https://www.suse.com/support/kb/doc/?id=000018546|META_LINK_SCC=https://scc.suse.com/dashboard|META_LINK_Register=https://www.suse.com/products/server/how-to-buy/";
-Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, 
OVERALL, OVERALL_INFO, OTHER_LINKS)
-
-OES_TAG = 'Microfocus'
-
-##############################################################################
-# Local Function Definitions
-##############################################################################
-
-def getRegService():
-       global OES_TAG
-       fileOpen = "updates.txt"
-       content = []
-       IDX_NUM = 0
-       IDX_ALIAS = 1
-       SERVICE_TAG = ''
-       SMT = re.compile("SMT-.*suse", re.IGNORECASE)
-       SUSE = re.compile("/updates.suse.com/|/scc.suse.com/", re.IGNORECASE)
-       OES = re.compile("/nu.novell.com/", re.IGNORECASE)
-       if Core.isFileActive(fileOpen):
-               section = "zypper --non-interactive --no-gpg-checks repos -d"
-               if Core.getRegExSection(fileOpen, "zypper --non-interactive 
--no-gpg-checks repos -d", content):
-                       IDX_URI = 8
-                       for line in content:
-                               PARTS = line.split('|')
-                               PARTS = [x.strip(' ') for x in PARTS]
-                               if( PARTS[IDX_NUM].isdigit() ):
-                                       REPO_ALIAS = PARTS[IDX_ALIAS].strip()
-                                       REPO_URI = PARTS[IDX_URI].strip()
-                                       if SUSE.search(PARTS[IDX_URI]):
-                                               SERVICE_TAG = 'SCC'
-                                       elif( 
PARTS[IDX_ALIAS].startswith('susemanager:') ):
-                                               SERVICE_TAG = 'SUMA'
-                                       elif( 
PARTS[IDX_ALIAS].startswith('spacewalk:') ):
-                                               SERVICE_TAG = 'SUMA'
-                                       elif SMT.search(PARTS[IDX_ALIAS]):
-                                               SERVICE_TAG = 'SMT'
-                                       elif OES.search(PARTS[IDX_URI]):
-                                               SERVICE_TAG = OES_TAG
-#                                      print(str(len(PARTS)) + ":" + 
str(SERVICE_TAG) + ": " + str(REPO_NUM) + '|' + str(REPO_ALIAS) + '\n  ' + 
str(REPO_URI))
-#                                      print(PARTS)
-               elif Core.getRegExSection(fileOpen, "zypper --non-interactive 
--no-gpg-checks repos -u", content):
-                       IDX_URI = 6
-                       for line in content:
-                               PARTS = line.split('|')
-                               PARTS = [x.strip(' ') for x in PARTS]
-                               if( PARTS[IDX_NUM].isdigit() ):
-                                       REPO_ALIAS = PARTS[IDX_ALIAS].strip()
-                                       REPO_URI = PARTS[IDX_URI].strip()
-                                       if SUSE.search(PARTS[IDX_URI]):
-                                               SERVICE_TAG = 'SCC'
-                                       elif( 
PARTS[IDX_ALIAS].startswith('susemanager:') ):
-                                               SERVICE_TAG = 'SUMA'
-                                       elif( 
PARTS[IDX_ALIAS].startswith('spacewalk:') ):
-                                               SERVICE_TAG = 'SUMA'
-                                       elif SMT.search(PARTS[IDX_ALIAS]):
-                                               SERVICE_TAG = 'SMT'
-                                       elif OES.search(PARTS[IDX_URI]):
-                                               SERVICE_TAG = OES_TAG
-#                                      print(str(len(PARTS)) + ":" + 
str(SERVICE_TAG) + ": " + str(REPO_NUM) + '|' + str(REPO_ALIAS) + '\n  ' + 
str(REPO_URI))
-#                                      print(PARTS)
-       return SERVICE_TAG
-
-def foundCredentials():
-       FILE_OPEN = "updates.txt"
-       CONTENT = []
-       IN_STATE = False
-       if Core.loadFullFile(FILE_OPEN, CONTENT):
-               for LINE in CONTENT:
-                       if( IN_STATE ):
-#                              print(LINE)
-                               if LINE.startswith('#==['):
-                                       IN_STATE = False
-#                                      print(' OUT_STATE')
-                               elif LINE.startswith('username='):
-                                       return True
-                       elif LINE.startswith('# /etc/zypp/credentials.d/'):
-#                              print('IN_STATE')
-                               IN_STATE = True
-
-       return False
-
-
-##############################################################################
-# Main Program Execution
-##############################################################################
-
-REG_LIST = []
-REG_ACTIVE = []
-REG_NOREG = []
-SCC_INFO = SUSE.getSCCInfo()
-REG_SERVICE = getRegService()
-REG_AUTH = foundCredentials()
-#print(REG_AUTH)
-if( SCC_INFO ):
-       for I in range(len(SCC_INFO)):
-               if( SCC_INFO[I]['status'] ):
-                       if( SCC_INFO[I]['status'].lower() == "registered" ):
-                               REG_LIST.append(SCC_INFO[I]['identifier'])
-                       elif( SCC_INFO[I]['status'].lower() == "not registered" 
):
-                               REG_NOREG.append(SCC_INFO[I]['identifier'])
-                       if 'subscription_status' in SCC_INFO[I]:
-                               if( SCC_INFO[I]['subscription_status'].lower() 
== "active" ):
-                                       
REG_ACTIVE.append(SCC_INFO[I]['identifier'])
-#              print(str(SCC_INFO[I]['identifier']) + ": " + 
str(SCC_INFO[I]['status']))
-#              print(SCC_INFO[I])
-#      print("\n")
-       if( len(REG_ACTIVE) > 0 ):
-               Core.updateStatus(Core.SUCC, "System Registered through " + 
str(REG_SERVICE) + ": " + ' '.join(REG_LIST))
-       elif( len(REG_LIST) > 0 ):
-               if( len(REG_SERVICE) > 0 ):
-                       Core.updateStatus(Core.SUCC, "System Remotely 
Registered through " + str(REG_SERVICE) + ": " + ' '.join(REG_LIST))
-               else:
-                       Core.updateStatus(Core.SUCC, "System Remotely 
Registered: " + ' '.join(REG_LIST))
-       elif( len(REG_NOREG) > 0 ):
-               if( len(REG_SERVICE) > 0 ):
-                       if( REG_AUTH ):
-                               Core.updateStatus(Core.SUCC, "System Remotely 
Registered through " + str(REG_SERVICE) + ": " + ' '.join(REG_NOREG))
-                       else:
-                               Core.updateStatus(Core.WARN, "Validate Remote 
Registration through " + str(REG_SERVICE) + ", missing credentials: " + ' 
'.join(REG_NOREG))
-               else:
-                       if( REG_AUTH ):
-                               Core.updateStatus(Core.WARN, "Invalid System 
Registration, Found credentials but no registration server")
-                       else:
-                               Core.updateStatus(Core.CRIT, "System Not 
Registered and Unsupported")
-       else:
-               Core.updateStatus(Core.WARN, "Validate System Registration")
-else:
-       if( len(REG_SERVICE) > 0 ):
-               if( REG_AUTH ):
-                       if( REG_SERVICE == OES_TAG ):
-                               Core.updateStatus(Core.WARN, "System Registered 
through " + str(REG_SERVICE) + ", Secondary Support Only")
-                       else:
-                               Core.updateStatus(Core.SUCC, "System Registered 
through " + str(REG_SERVICE))
-               else:
-                       Core.updateStatus(Core.CRIT, "System Not Registered and 
Unsupported - No Credentials")
-       else:
-               Core.updateStatus(Core.CRIT, "System Not Registered and 
Unsupported")
-
-Core.printPatternResults()
-

Reply via email to