Re: Bug#868267: fai-client: fetch-basefile breaks for hostnames with hyphens

2017-07-26 Thread Thomas Lange
> On Thu, 13 Jul 2017 17:41:56 -0400, Arcady Genkin > said: > guessing that the hyphen in the host name is causing the problem (the hostname > is "eddie-vm.teach.cs.toronto.edu" which defines a FAI class of the same name). Hi Arcady, the problem is, that FAI class names should

Re: Bug#868267: fai-client: fetch-basefile breaks for hostnames with hyphens

2017-07-26 Thread Andreas Heinlein
Am 26.07.2017 um 15:51 schrieb Thomas Lange: >> On Thu, 13 Jul 2017 17:41:56 -0400, Arcady Genkin >> said: > > guessing that the hyphen in the host name is causing the problem (the > hostname > > is "eddie-vm.teach.cs.toronto.edu" which defines a FAI class of the > same name). >

Re: Bug#868267: fai-client: fetch-basefile breaks for hostnames with hyphens

2017-07-26 Thread andrew bezella
in general, the hyphen not being allowed in a class name seems a documented restriction and not a bug. the fai-class man page states: > All class names should be written in uppercase letters (execpt the class  > of the hostname). Do not use a dash, use an underscore. it could perhaps be re-worded

Re: Bug#868267: fai-client: fetch-basefile breaks for hostnames with hyphens

2017-07-26 Thread andrew bezella
On Wed, 2017-07-26 at 08:35 -0700, andrew bezella wrote: > it could perhaps be re-worded along the lines of "All class names are > restricted to uppercase letters and underscores [A-Z_] (except the > FAI- > defined class matching the hostname)" and maybe placed more > prominently > in the man page

Re: Bug#868267: fai-client: fetch-basefile breaks for hostnames with hyphens

2017-07-26 Thread Thomas Lange
> On Wed, 26 Jul 2017 11:45:20 -0400, Arcady Genkin > said: > I think that the > approach to replace hyphens and any other illegal characters with underscores > is a very good one. And we have dots in FQDN, which are currently also not allowed in class names. Should we trun

Re: Bug#868267: fai-client: fetch-basefile breaks for hostnames with hyphens

2017-07-26 Thread andrew bezella
On Wed, 2017-07-26 at 21:17 +0200, Thomas Lange wrote: > And we have dots in FQDN, which are currently also not allowed in > class names. Should we truncate the FQDN before defining the hostname > as a class or replace  the dots with the underscore? if this is implemented, i'd say replace the dots

Re: Bug#868267: fai-client: fetch-basefile breaks for hostnames with hyphens

2017-07-26 Thread andrew bezella
On Wed, 2017-07-26 at 17:34 -0400, Arcady Genkin wrote: [...] > # chroot /data/fai-nfsroots/xenial-x64 /bin/bash --version |head -1 > GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu) ah! ok, apparently a change in bash's behavior between 4.3 and 4.4: % bash --version | head -n1 GNU bash,

Re: Bug#868267: fai-client: fetch-basefile breaks for hostnames with hyphens

2017-07-27 Thread Thomas Lange
I have patched fetch-basefile so this should now work as expected. Instead of an eval and indirect shell variables, I just use an array and loop over this. No performce penalty unless you have some thousands of classes defined for a client and a million of base files ;-) Here are the diffs: https:

Re: Bug#868267: fai-client: fetch-basefile breaks for hostnames with hyphens

2017-07-27 Thread andrew bezella
thanks for following up on this! i think the stripping of the file extension (line 47 in the old code) needs to be added back in, otherwise the defined classes would have to match the basefile+extension: https://github.com/faiproject/fai/pull/61 i also noticed that one problem with this approach