Branch Coverage

blib/lib/Helios/Config.pm
Criterion Covered Total %
branch 0 96 0.0


line true false branch
133 0 0 @_ ? :
134 0 0 @_ ? :
187 0 0 if ($self->debug)
193 0 0 if ($self->debug)
278 0 0 if (defined $params{'conf_file'})
279 0 0 if (defined $params{'service'})
280 0 0 if (defined $params{'hostname'})
281 0 0 if (defined $params{'debug'})
284 0 0 unless ($self->getHostname)
288 0 0 if (not defined $self->getConfFile and defined $ENV{'HELIOS_INI'})
383 0 0 if (@_ or not $self->getConfFile && $self->getHostname)
388 0 0 if ($self->getConfFileConfig) { }
468 0 0 @_ ? :
469 0 0 @_ ? :
472 0 0 unless ($conf_file)
473 0 0 unless (-r $conf_file)
476 0 0 unless (defined $cif)
483 0 0 if ($cif->SectionExists('global'))
491 0 0 if ($cif->SectionExists($service_name))
547 0 0 @_ ? :
548 0 0 @_ ? :
562 0 0 if ($self->debug)
563 0 0 if ($_->host eq '*') { }
594 0 0 if (scalar @_ == 1) { }
599 0 0 defined $params{'service'} ? :
601 0 0 defined $params{'hostname'} ? :
606 0 0 if (defined $self->getConfig and defined $self->getService and $self->getService eq $service_name and defined $self->getHostname and $self->getHostname eq $host and defined $self->getConfig->{$param_name})
615 0 0 unless ($service_name and $host and $param_name)
631 0 0 if ($self->debug)
632 0 0 if ($_->host eq '*') { }
642 0 0 if ($host ne '*' and defined $conf_this_host{$param_name})
647 0 0 unless (eval { do { my $driver = $self->getDriver; my(@dbparams) = $driver->search('Helios::ConfigParam', {'worker_class', $service_name, 'param', $param_name, 'host', ['*', $host]}); my(%conf_all_hosts, %conf_this_host); foreach $_ (@dbparams) { if ($self->debug) { print $_->worker_class, '|', $_->host, '|', $_->param, '=>', $_->value, "\n"; } ; if ($_->host eq '*') { $conf_all_hosts{$_->param} = $_->value; } else { $conf_this_host{$_->param} = $_->value; } ; } ; $conf = \%conf_all_hosts; if ($host ne '*' and defined $conf_this_host{$param_name}) { $conf->{$param_name} = $conf_this_host{$param_name}; } ; 1 } })
652 0 0 if ($self->debug and not defined $conf->{$param_name})
670 0 0 if ($self->debug)
675 0 0 unless (eval { do { my $driver = $self->getDriver; my(@dbparams) = $driver->search('Helios::ConfigParam'); foreach $_ (@dbparams) { if ($self->debug) { print $_->param, '=>', $_->value, "\n"; } ; $$conf{$_->worker_class}{$_->host}{$_->param} = $_->value; } ; 1 } })
697 0 0 defined $params{'service'} ? :
699 0 0 defined $params{'hostname'} ? :
704 0 0 unless ($service_name and $host and $param_name and defined $value)
730 0 0 if (defined $cp) { }
731 0 0 if ($self->debug)
741 0 0 if ($self->debug)
745 0 0 if ($self->debug)
754 0 0 unless (eval { do { my $driver = $self->getDriver; my(@cps) = $driver->search('Helios::ConfigParam', {'worker_class', $service_name, 'param', $param_name, 'host', $host}); my $cp = shift @cps; if (defined $cp) { if ($self->debug) { print "$service_name|$host|$param_name already set to ", $cp->value, ". Clearing.\n"; } ; $driver->remove('Helios::ConfigParam', {'worker_class', $service_name, 'host', $host, 'param', $param_name}, {'nofetch', 1}); } else { if ($self->debug) { print "$service_name|$host|$param_name not found. Creating.\n"; } ; } ; if ($self->debug) { print "$service_name|$host|$param_name setting to $value\n"; } ; $cp = 'Helios::ConfigParam'->new; $cp->worker_class($service_name); $cp->host($host); $cp->param($param_name); $cp->value($value); $driver->insert($cp); 1 } })
778 0 0 defined $params{'service'} ? :
780 0 0 defined $params{'hostname'} ? :
784 0 0 unless ($service_name and $host and $param_name)
791 0 0 if ($self->debug)
802 0 0 unless (eval { do { my $driver = $self->getDriver; if ($self->debug) { print "Clearing $service_name|$host|$param_name from param table.\n"; } ; $driver->remove('Helios::ConfigParam', {'worker_class', $service_name, 'host', $host, 'param', $param_name}, {'nofetch', 1}); 1 } })