OTHER_LINKS = "META_LINK_TID=https://www.suse.com/support/kb/doc.php?id=7016683|https://bugzilla.suse.com/show_bug.cgi?id=938098"

Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS)

##############################################################################
# Local Function Definitions
##############################################################################


##############################################################################
# Main Program Execution
##############################################################################

SERVICE = 'lvm2-activation.service'
SERVICE_INFO = SUSE.getServiceDInfo(SERVICE)
LVM_CONFIG = SUSE.getConfigFileLVM('activation')
if "vgchange -aay" in SERVICE_INFO['ExecStart']: #auto activation detected
	if( LVM_CONFIG ): # a valid lvm config file exists
		if( 'volume_list' in LVM_CONFIG.keys() ): # there is a volume_list entry in lvm.conf
			if( len(LVM_CONFIG['volume_list']) > 0 ): # there are values associated with the volume_list entry
				if( 'auto_activation_volume_list' in LVM_CONFIG.keys() ): # there is an auto_activation_volume_list entry in lvm.conf
					if( len(LVM_CONFIG['auto_activation_volume_list']) > 0 ): # there are values associated with the auto_activation_volume_list entry
						if set(LVM_CONFIG['volume_list']).issubset(LVM_CONFIG['auto_activation_volume_list']): # all required entries found in auto_activation_volume_list
							Core.updateStatus(Core.IGNORE, "All volume_list entries are found within the auto_activation_volume_list, ignore")
						else: # some volume_list entries are missing from the auto_activation_volume_list
							if( SERVICE_INFO['ExecMainStatus'] == '5' ): # found the error associated with missing auto_activation_volume_list entries
								Core.updateStatus(Core.WARN, "Missing auto_activation_volume_list entries in lvm.conf")
							else: # didn't fine the error associated with missing auto_activation_volume_list entries
								Core.updateStatus(Core.WARN, "An auto_activation_volume_list entry in lvm.conf may be needed to avoid errors")
					else: # no auto_activation_volume_list entries found
						if( SERVICE_INFO['ExecMainStatus'] == '5' ): # found the error associated with missing auto_activation_volume_list entries