/
casa-7015222.py
85 lines (73 loc) · 3.43 KB
/
casa-7015222.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/python
# Title: "CASAcli -l" returns "Found 0 credential sets" after update
# Description: After applying glibc-2.11.3-17.62.1 CASA credentials go missing
# Modified: 2014 Jul 24
#
##############################################################################
# Copyright (C) 2014 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, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Authors/Contributors:
# Rance Burker (rtburker@suse.com)
#
##############################################################################
##############################################################################
# Module Definition
##############################################################################
import sys, os, Core, SUSE
##############################################################################
# Overriden (eventually or in part) from SDP::Core Module
##############################################################################
META_CLASS = "OES"
META_CATEGORY = "CASA"
META_COMPONENT = "CASA"
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.novell.com/support/kb/doc.php?id=7015222|META_LINK_BUG=https://bugzilla.novell.com/show_bug.cgi?id=883217"
Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS)
##############################################################################
# Local Function Definitions
##############################################################################
def missingCASACredentials():
fileOpen = "env.txt"
section = 'CASAcli -l'
content = {}
if Core.getSection(fileOpen, section, content):
for line in content:
if "Found 0 credential set" in content[line]:
return True
return False
##############################################################################
# Main Program Execution
##############################################################################
PACKAGE_NAME = 'glibc'
BROKE_VERSION = '2.11.3-17.62.1'
if( SUSE.packageInstalled(PACKAGE_NAME) ):
INFO = SUSE.getRpmInfo(PACKAGE_NAME)
# print "INFO = " + str(INFO)
# if( INFO['version'] == BROKE_VERSION ):
if( INFO['version'] == BROKE_VERSION and FIXED_VERSION > INFO['version']):
if( missingCASACredentials() ):
Core.updateStatus(Core.CRIT, "CASA credentials missing")
else:
Core.updateStatus(Core.IGNORE, "CASA credentials present")
else:
Core.updateStatus(Core.IGNORE, "Valid version installed, issue fixed")
else:
Core.updateStatus(Core.ERROR, "Package not installed, abort test")
Core.printPatternResults()