TT#17501 Use the new general.ngcp_type variable from constants.yml

Stop inferring from the metapackage presence and instead use the
variable general.ngcp_type from the constants.yml file which should now
always be present.

Change-Id: I68e97f6894094fe6a1589fa73b048b061eae4a7b
changes/34/13834/4
Guillem Jover 9 years ago
parent e597d2b342
commit efcf7e0eea

1
debian/control vendored

@ -40,7 +40,6 @@ Depends: etckeeper,
libdata-validate-ip-perl,
libdbd-mysql-perl,
libdbi-perl,
libdpkg-perl,
libhash-merge-perl,
libio-interface-perl,
libipc-system-simple-perl,

@ -1,29 +1,9 @@
[%
# Returns the ngcp_type of the node calling this function.
#
# This function is obsolete and for backwards compatibility only, as it
# can be replaced by directly getting the general.ngcp_type variable.
#
# @return out one of ['spce', 'sppro', 'carrier']
-%]
[% PERL -%]
use Dpkg;
use Dpkg::Index;
use Dpkg::Control::Types;
my $status = Dpkg::Index->new(type => CTRL_INFO_PKG);
$status->load("$Dpkg::ADMINDIR/status");
my $pkg = $status->get_by_key('ngcp-ngcp-ce');
if ($pkg->{Status} =~ m/\s+ok\s+installed$/) {
$stash->set(out => 'spce');
return;
}
$pkg = $status->get_by_key('ngcp-ngcp-pro');
if ($pkg->{Status} =~ m/\s+ok\s+installed$/) {
$stash->set(out => 'sppro');
return;
}
$pkg = $status->get_by_key('ngcp-ngcp-carrier');
if ($pkg->{Status} =~ m/\s+ok\s+installed$/) {
$stash->set(out => 'carrier');
return;
}
[% END -%]
[% out = general.ngcp_type -%]

Loading…
Cancel
Save