Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upper method in tt files gives an empty string #88

Closed
StephaneGerardVUB opened this issue Apr 18, 2015 · 5 comments
Closed

upper method in tt files gives an empty string #88

StephaneGerardVUB opened this issue Apr 18, 2015 · 5 comments
Milestone

Comments

@StephaneGerardVUB
Copy link

Hi,
I'm facing this issue when I try to define a vnet with ncm-opennebula on a SL6.6 machine. Here is a code that isolates the problem :

#!/usr/bin/perl
use lib '/usr/lib/perl';
use CAF::TextRender;
my $module = 'vnet';
my %vnet = ('bridge' , 'br0', 'dns', '193.58.172.5', 'gateway', '192.168.10.200', 'name', 'Private', 'network_mask', '255.255.0.0', 'type', 'FIXED');
my $contents = \%vnet;
my $trd = CAF::TextRender->new($module, {'vnet' => $contents}, relpath => 'opennebula', log => $self);
print "$trd";

The ouput of this code is the following :

 = "br0"
 = "193.58.172.5"
 = "192.168.10.200"
 = "Private"
 = "255.255.0.0"
 = "FIXED"
QUATTOR = 1

I guess this is due to "upper" methode in vnet.tt :

[% FOR pair IN vnet.pairs -%]
[%    pair.key.upper %] = "[% pair.value %]"
[% END -%]
QUATTOR = 1

Could this be due to bug in perl-Template-Toolkit-2.22-5.el6.x86_64 ?
Cheers,
Stéphane

@stdweird
Copy link
Member

@StephaneGerardVUB yes, .upper doesn't work with older perl-Template-Toolkit. we should use pair.key FILTER upper for that (see also stdweird/configuration-modules-core@f837f95)

@jrha as soon as we will run the unittests on EL6 for the release, this would have popped up 😉

@alvarosimon can you look for this (and we need to run the tests under EL6 asap)

@alvarosimon
Copy link
Member

@stdweird, @StephaneGerardVUB yes I will test this in a EL6 as soon as possible

@alvarosimon
Copy link
Member

@stdweird opennebula AII is not affected by this, I will modify the current opennebula component PR to fix this asap

@alvarosimon
Copy link
Member

Updated opennebula component PR: quattor/configuration-modules-core#466 to fix this issue

@jrha jrha added this to the 15.4 milestone Apr 20, 2015
@jrha
Copy link
Member

jrha commented Apr 27, 2015

Fixed by quattor/configuration-modules-core#466.

@jrha jrha closed this as completed Apr 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants