You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcpcfg/lib/get_ngcp_version

20 lines
517 B

[%
# Returns the ngcp_version of the node calling this function.
#
# @return out ngcp version (e.g. 'mr4.5.3' or 'trunk')
-%]
[% 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 -%]