mirror of https://github.com/sipwise/ngcpcfg.git
There are currently several places in templates where we do request ngcp version, lets create a helper here, then we will be able to switch on it after the next LTS is released (mr5.5). Unfortunately we cannot switch on it before the next LTS, otherwise upgrade mr4.4->mr5.5 may be corrupted by users. If sp1 has been upgraded already and sp2 is not while sp2 has received new templates already while ngcpcfg package is still old -> templates cannot be built as helper is not found. Change-Id: Icce966097335eddb7b09303ac2ef8081092bb8f3changes/00/10600/1
parent
f7d4d594c4
commit
be3573332b
@ -0,0 +1,19 @@
|
||||
[%
|
||||
# Returns the ngcp_version of the node calling this function.
|
||||
#
|
||||
# @return out one of ['spce', 'sppro', 'carrier']
|
||||
-%]
|
||||
[% PERL -%]
|
||||
my $filename = '/etc/ngcp_upgrade_version';
|
||||
unless (-e $filename) {
|
||||
$filename = '/etc/ngcp_version';
|
||||
}
|
||||
open my $hh, '<', $filename or die "Error opening $filename";
|
||||
my $ngcp_version = <$hh>;
|
||||
close $hh;
|
||||
chomp $ngcp_version;
|
||||
die "Fatal error retrieving ngcp_version [$ngcp_version]" unless length $ngcp_version;
|
||||
|
||||
$stash->set(out => $ngcp_version);
|
||||
return;
|
||||
[% END -%]
|
||||
Loading…
Reference in new issue