8000 Move first argument of kopts_overwrite to the end and make it optional by SchoolGuy · Pull Request #2651 · cobbler/cobbler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Move first argument of kopts_overwrite to the end and make it optional #2651

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

Merged
merged 1 commit into from
May 28, 2021

Conversation

SchoolGuy
Copy link
Member

I did this because passing the whole object is not desired since we only need the name I changed the method signature.

@SchoolGuy SchoolGuy added this to the v3.3.0 milestone May 28, 2021
@SchoolGuy SchoolGuy requested a review from nodeg May 28, 2021 09:00
@SchoolGuy SchoolGuy force-pushed the refactor-utils-kopts branch from 213e462 to ca49191 Compare May 28, 2021 11:46
Copy link
Member
@nodeg nodeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although the tests see it otherway.

We have to fix the system.name issue before merging.

[Thread-2874] 2021-05-28T12:10:57 - INFO | Writing template files for testdistro0
[Thread-2874] 2021-05-28T12:10:57 - INFO | Exception occurred: <class 'AttributeError'>
[Thread-2874] 2021-05-28T12:10:57 - INFO | Exception value: 'NoneType' object has no attribute 'name'
[Thread-2874] 2021-05-28T12:10:57 - INFO | Exception Info:
  File "/usr/lib/python3.6/site-packages/cobbler/remote.py", line 3645, in _dispatch
    return method_handle(*params)

  File "/usr/lib/python3.6/site-packages/cobbler/remote.py", line 1995, in save_distro
    return self.save_item("distro", object_id, token, editmode=editmode)

  File "/usr/lib/python3.6/site-packages/cobbler/remote.py", line 1982, in save_item
    self.api.add_item(what, obj)

  File "/usr/lib/python3.6/site-packages/cobbler/api.py", line 750, in add_item
    self.get_items(what).add(ref, check_for_duplicate_names=check_for_duplicate_names, save=save)

  File "/usr/lib/python3.6/site-packages/cobbler/cobbler_collections/collection.py", line 403, in add
    self.lite_sync.add_single_distro(ref.name)

  File "/usr/lib/python3.6/site-packages/cobbler/actions/sync.py", line 336, in add_single_distro
    self.tftpgen.make_pxe_menu()

  File "/usr/lib/python3.6/site-packages/cobbler/tftpgen.py", line 312, in make_pxe_menu
    metadata = self.get_menu_items()

  File "/usr/lib/python3.6/site-packages/cobbler/tftpgen.py", line 359, in get_menu_items
    return self.get_menu_level(None, arch)

  File "/usr/lib/python3.6/site-packages/cobbler/tftpgen.py", line 536, in get_menu_level
    self.get_profiles_menu(menu, metadata, arch)

  File "/usr/lib/python3.6/site-packages/cobbler/tftpgen.py", line 436, in get_profiles_menu
    image=None, format=boot_loader)

  File "/usr/lib/python3.6/site-packages/cobbler/tftpgen.py", line 664, in write_pxe_file
    image, arch, metadata["autoinstall"])

  File "/usr/lib/python3.6/site-packages/cobbler/tftpgen.py", line 843, in build_kernel_options
    utils.kopts_overwrite(distro, kopts, self.settings, system.name)

@SchoolGuy SchoolGuy force-pushed the refactor-utils-kopts branch from ca49191 to d15f920 Compare May 28, 2021 12:32
@SchoolGuy
Copy link
Member Author

This method was now converted to "I am paranoid and mentally ill" way of running.

@nodeg
Copy link
Member
nodeg commented May 28, 2021

That looks much better now. So the typechecking is indeed important and improves the overall code.

@nodeg nodeg merged commit 2c47462 into master May 28, 2021
@SchoolGuy SchoolGuy deleted the refactor-utils-kopts branch June 11, 2021 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0