Code Monkey home page Code Monkey logo

Comments (7)

SchoolGuy avatar SchoolGuy commented on June 2, 2024

The line in grub.py you are addressing is present as of 3.3.0. The file was last changed three years ago. As such it is unlikely that this is caused by an upgrade from 3.3.3 to 3.3.4.

from cobbler.

rdswett avatar rdswett commented on June 2, 2024

I think the change that is causing the issue is in tftpgen.py on line 777, which was introduced in a pull request a few months ago. In 3.3.3 the kernel path was just taken as is, and in 3.3.4 an additional check was added and the call to the parse_grub_remote_file function.

from cobbler.

SchoolGuy avatar SchoolGuy commented on June 2, 2024

@rdswett it would be cool if you could link the PR. In any case I will see what I can do about your bug in the coming weeks.

from cobbler.

rdswett avatar rdswett commented on June 2, 2024

Git claims it is this one #3477, thanks for looking into it!

from cobbler.

SchoolGuy avatar SchoolGuy commented on June 2, 2024

@tpw56j if you have the time I would be thrilled if you could take a look at this bug.

from cobbler.

tpw56j avatar tpw56j commented on June 2, 2024

I tested.

# cobbler distro add --name=distro_test1 --remote-boot-kernel='http://192.168.0.2/vmlinuz' \
--remote-boot-initrd='http://192.168.0.2/initrd.img' --breed=redhat --os-version=rhel9
# cobbler distro report --name=distro_test1
Name                           : distro_test1
Architecture                   : x86_64
Automatic Installation Template Metadata : {}
TFTP Boot Files                : {}
Boot loaders                   : <<inherit>>
Breed                          : redhat
Comment                        : 
Fetchable Files                : {}
Initrd                         : 
Kernel                         : 
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
OS Version                     : rhel9
Owners                         : <<inherit>>
Redhat Management Key          : <<inherit>>
Remote Boot Initrd             : http://192.168.0.2/initrd.img
Remote Boot Kernel             : http://192.168.0.2/vmlinuz
Template Files                 : {}

# cobbler profile add --name=profile_test1 --distro=distro_test1

Correct grub menu with loading via http:

menuentry 'profile_test1' --class gnu-linux --class gnu --class os {
  echo 'Loading kernel ...'
  clinux (http,192.168.0.2)/vmlinuz   inst.ks.sendmac inst.ks=http://192.168.122.1/cblr/svc/op/autoinstall/profile/profile_test1
  echo 'Loading initial ramdisk ...'
  cinitrd (http,192.168.0.2)/initrd.img
  echo '...done'
}

But using the hostname does result in an error:

 cobbler distro add --name=distro_test2 --remote-boot-kernel='http://www.example.com/vmlinuz' \
--remote-boot-initrd='http://192.168.0.2/initrd.img' --breed=redhat --os-version=rhel9
exception on server: Invalid remote file format http://www.example.com/vmlinuz
www.example.com is not a valid IP address

  File "/usr/lib/python3.12/site-packages/cobbler/remote.py", line 3928, in _dispatch
    return method_handle(*params)
           ^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/lib/python3.12/site-packages/cobbler/remote.py", line 2135, in xapi_object_edit
    self.modify_item(object_type, handle, key, value, token)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/lib/python3.12/site-packages/cobbler/remote.py", line 1862, in modify_item
    setattr(obj, attribute, arg)

  File "/usr/lib/python3.12/site-packages/cobbler/items/item.py", line 371, in __setattr__
    super().__setattr__(name, value)

  File "/usr/lib/python3.12/site-packages/cobbler/items/distro.py", line 312, in remote_boot_kernel
    parsed_url = grub.parse_grub_remote_file(remote_boot_kernel)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/lib/python3.12/site-packages/cobbler/grub.py", line 41, in parse_grub_remote_file
    raise ValueError(

Maybe we should remove the IP address check in grub.py?

from cobbler.

SchoolGuy avatar SchoolGuy commented on June 2, 2024

Hm... I am not 100% sure if that is the right way as we rebuild the URL for remote boot purposes. As such having a valid hostname or IP is desirable in my eyes.

from cobbler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.