######## PARENT CONFIG ##############
DEPLOY :
SWG_Lower HOLDS SWG_Depot
EQUALS:=
total_dist: completion= SUCCESS
total_finish: completion= SUCESS
total_cancel:completion=SUCCESS
DEPLOYED
DEPLOY:
LOADED_Lower HOLDS SWG_Depot
EQUALS =
total_finish: completion= SUCCES
total_cancel: completion=SUCCESS
DEPLOYED
DEPLOY:
CONFIG_Lower HOLDS SWG_Depot
EQUALS =
total_cancel: completion=SUCCESS
DEPLOYED
######### INHERITED CHILD CONFIG ###############
DEPLOY
first_distribution HOLDS LOADED_Lower
DEPLOYED
DEPLOY:
second_distribution HOLDS CONFIG_Lower ;
DEPLOYED
DEPLOY :
third_distribution HOLDS LOADED_Lower;
DEPLOYED
DEPLOY :
forth_distribution HOLDS SWG_Lower ;
DEPLOYED
####
while( $line = )
{
next unless $line =~ m<\s+(\S+)\sHOLDS\s(.+)>x;
$key = $1; #Obtains first_distribution, etc
if ($line =~ /(\S+_Lower)\sHOLDS\s\S+/i)
{
$base_type = $1; #obtains parent config ID (eg SWG_Lower )
while ($line =~ m<\s(\S+):\s(completion).+>gx) # obtaining attributes
{
push(@{$base{$base_type}}, $1);}} # push each attribute associated with parent ID into an hash of arrays
# eg A dump from the hash looks like this which is correct SWG_Lower:: total_dist total_finish total_cancel
LOADED_Lower:: total_finish, total_cancel
: CONFIG_Lower: total_cancel
next unless exists $results{$key}; # I do this incase there are distribution ids in the file which are not in my hash
####
DEPLOY:
second_distribution HOLDS CONFIG_Lower ;
DEPLOYED
####
DEPLOY :
forth_distribution HOLDS SWG_Lower ;
DEPLOYED