Bug #26
closed
Link to "pxe template" does not contian major and minor version number
Added by Oded Ben Ozer about 15 years ago.
Updated about 15 years ago.
Description
When creating a new OS your are instructed(by the examples) to put OS major and minor version number in separate fields,but these values are not present in the links created in pxelinux.cfg directory,this prevents you from using different kernel and initrd for different OS versions(which is mandatory)
I'm not sure I understand the problem, lets take for example CentOS 5.3
if your OS name is CentOS, major is 5 and minor is 3, and your host arch is 32bit, Foreman will create a link to:CentOS-5.3-i386.
You can see at /app/models/host.rb line 243:
GW::Tftp.create([mac, os.to_s.gsub(" ","-"), arch.name, serial])
that link is created as mac-->os_name.arch_name .
In my test OS did not include what I entered in the major & minor version fields when I've created the os object.
Another thing is that after adding an OS with major and minor numbers you can not edit them (major,minor) again
Moty
Moty Lavi wrote:
You can see at /app/models/host.rb line 243:
GW::Tftp.create([mac, os.to_s.gsub(" ","-"), arch.name, serial])
that link is created as mac-->os_name.arch_name .
In my test OS did not include what I entered in the major & minor version fields when I've created the os object.
have a look inside the os.to_s:
"#{name} #{major}#{('.' + minor) unless minor.empty?}"
that would not add the minor if it doesn't exists..
Another thing is that after adding an OS with major and minor numbers you can not edit them (major,minor) again
yeah, that's correct, I guess that I've missed that. can you create another ticket for that?
In "settings-->operating systems-->create new" I had the following fields filled:
Name: RedHat Enterprise Linux
Architectures: i386
major: 5
minor: 3
I added output to log of major and minor before:
"#{name} #{major}#{('.' + minor) unless minor.empty?}"
And I get
major=RedHat
minor is empty
- Category set to TFTP
- Status changed from New to Assigned
- Assignee set to Ohad Levy
- Target version set to 0.1-2
Moty Lavi wrote:
In "settings-->operating systems-->create new" I had the following fields filled:
Name: RedHat Enterprise Linux
Architectures: i386
major: 5
minor: 3
I added output to log of major and minor before:
"#{name} #{major}#{('.' + minor) unless minor.empty?}"
And I get
major=RedHat
minor is empty
You are correct: in the console:
Operatingsystem.last.to_s
=> "RedHat Enterprise Linux"
Operatingsystem.last.to_label
=> "RedHat Enterprise Linux 5.3"
it seems that my to_s method doesn't override the string.to_s method, I'll fix that.
- Status changed from Assigned to Ready For Testing
- % Done changed from 0 to 100
pxe links are created with major and minor numbers !
gr8
- Status changed from Ready For Testing to Closed
Also available in: Atom
PDF