8000 CLI: Typecheck related issues · Issue #2732 · cobbler/cobbler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

CLI: Typecheck related issues #2732

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

Closed
1 task
nodeg opened this issue Aug 3, 2021 · 1 comment · Fixed by #2733
Closed
1 task

CLI: Typecheck related issues #2732

nodeg opened this issue Aug 3, 2021 · 1 comment · Fixed by #2733
Assignees
Labels
documentation Improvements or additions to documentation main Not a release but referring to the Git main branch Usability
Milestone

Comments

@nodeg
Copy link
Member
nodeg commented Aug 3, 2021

Describe the bug

This is a collection of issues related to the recently introduces typechecks. #2722 is related.

Steps to reproduce

  1. Create a distro and a profile
  2. Cretate a system
  3. Edit system parameters
  4. See that not everything is working

Expected behavior

The CLI should work as expected with the commands/options/values given.

Cobbler version

Master branch

Operating system

openSUSE Tumbleweed

Issues

  • Network interfaces not deletable
$ cobbler system edit --name stest --interface test2
$ cobbler system edit --name stest --delete-interface test2  
exception on server: The name of the interface must be of type str

# log

[Thread-9] 2021-08-03T10:42:21 - DEBUG | done with get_item; ['system', 'stest']
  [Thread-9] 2021-08-03T10:42:21 - INFO | Exception occurred: <class 'TypeError'>
  [Thread-9] 2021-08-03T10:42:21 - INFO | Exception value: ('The name of the interface must be of type str: %s', <class 'NoneType'>)
  [Thread-9] 2021-08-03T10:42:21 - INFO | Exception Info:
    File "/usr/local/lib/python3.8/site-packages/cobbler/remote.py", line 3514, in _dispatch
      return method_handle(*params)
   
    File "/usr/local/lib/python3.8/site-packages/cobbler/remote.py", line 1950, in xapi_object_edit
      self.__interface_edits(handle, attributes, object_name)
   
    File "/usr/local/lib/python3.8/site-packages/cobbler/remote.py", line 1994, in __interface_edits
      system_to_edit.delete_interface(attributes.get("interface"))
   
    File "/usr/local/lib/python3.8/site-packages/cobbler/items/system.py", line 860, in delete_interface
      raise TypeError("The name of the interface must be of type str: %s", type(name))

Apparently this is not an actual issue but a missing documentation. When editing interface related things, you have to always provide the interface name via --interface name.

So when doing the same command as above with the mentioned interface it works as expected:

$ cobbler system edit --name stest --interface test2 --delete-interface
@nodeg nodeg added Usability Bug Report Reporting a bug main Not a release but referring to the Git main branch labels Aug 3, 2021
@nodeg nodeg added this to the v3.3.0 milestone Aug 3, 2021
@nodeg nodeg linked a pull request Aug 3, 2021 that will close this issue
@nodeg nodeg self-assigned this Aug 3, 2021
@nodeg nodeg added documentation Improvements or additions to documentation and removed Bug Report Reporting a bug labels Aug 3, 2021
@nodeg
Copy link
Member Author
nodeg commented Aug 3, 2021

Closed for now since this is not an issue.

@nodeg nodeg closed this as completed Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation main Not a release but referring to the Git main branch Usability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0