Cobbler 4.0.0 compability#82
Draft
SchoolGuy wants to merge 23 commits into
Draft
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 2 minor 13 high 3 critical 34 medium |
🟢 Metrics 222 complexity · 22 duplication
Metric Results Complexity 222 Duplication 22
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
15 tasks
a16c40a to
b18d188
Compare
22b1612 to
e6f2c3d
Compare
Adds the new NetworkInterface item type that the Cobbler 4.0.0 backend exposes as a peer of System/Distro/Profile rather than as a Dict embedded in System. - network_interface.go: NetworkInterface struct with nested IPv4Option, IPv6Option, DNSInterfaceOption value objects; full CRUD wrappers (Get, GetHandle, GetSince, Find, FindNames, Create, Update, Save, Copy, Delete, DeleteRecursive, Rename, ListNames). new_network_interface uniquely requires a system_uid parameter; the wrapper plumbs it through. - system.go: drop the obsolete client-level interface mutation helpers (ModifyInterface, DeleteNetworkInterface, RenameNetworkInterface) and their System-method wrappers (CreateInterface, ModifyNetworkInterface, DeleteInterface, RenameInterface, makeInterfaceOptionsMap). The 4.0.0 backend no longer routes interface writes through modify_system pseudo- attributes. The Interface struct, Interfaces type, NewInterface and the read-only System.GetInterfaces / GetInterface remain for now; the full swap to map[string]*NetworkInterface lives in a follow-up commit per Task 6 of the implementation plan. - cobblerclient.go: drop the updateInterfaces branch in updateCobblerFields (Interfaces is now noupdate on System). - cmd/main.go: update the runnable example to use the new top-level CreateNetworkInterface / DeleteNetworkInterface API. - Tests: delete TestCreateInterface, TestModifyInterface, TestDeleteInterface, TestRenameInterface and their fixtures. - go.mod: drop github.com/fatih/structs (only used by deleted code).
88a4b45 to
ecfd5d9
Compare
Adds the new Template item type that Cobbler 4.0.0 exposes for autoinstall template management (Jinja2, Cheetah, etc.). The legacy file-based wrapper (read_/write_/remove_autoinstall_template and get_autoinstall_templates) is gone from the 4.0.0 backend, so the matching Go wrappers and fixtures are removed. - template_types.go: TemplateSchema enum (file/importlib/environment), URIOption struct (schema + path). - template.go: Template struct, NewTemplate, convertRawTemplate, full CRUD wrappers, GetTemplateHandle, GetTemplatesSince, FindTemplate, FindTemplateNames, ListTemplateNames plus the content-management helpers GetTemplateContent / TemplatesRefreshContent / BackgroundTemplatesRefreshContent. - Removed: template_file.go, template_file_test.go, the corresponding fixtures, the GetAutoinstallTemplates wrapper, and the cmd/main.go example block (replaced with the new CreateTemplate flow). The TemplateFiles dict field on items (a separate per-item construct for in-image file rendering) is unrelated and stays unchanged.
Cobbler 4.0.0 always supports the `resolved` boolean on the get_<item> XML-RPC methods (the parameter was added in 3.3.3 and the v1.x client targets 4.0.0+). Inline the post-3.3.3 wire shape in getConcreteItem and update the get_<item> request fixtures to carry the extra param. Remove the now-pointless CachedVersion presets from item tests. The CachedVersion field on Client and the setCachedVersion helper stay in place for ExtendedVersion consumers and any future version-gated work.
Python's save_item(what, object_id, with_triggers, with_sync, editmode, token) takes 6 positional args. The Go client was passing only (what, objectId, token, editmode) — missing with_triggers/with_sync, and swapping token and editmode. Update SaveItem, SaveDistro, SaveProfile, SaveSystem, SaveRepo, SaveImage, SaveMenu, SaveNetworkInterface, SaveTemplate to the correct 4-param Go signature (objectId, withTriggers, withSync, editmode) with token appended internally via c.Token. Fix CreateDistro/UpdateDistro which bypassed SaveDistro entirely and called save_distro with only 2 args. Update all internal Create*/Update* callers. Update corresponding test call sites and fixture XML files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Python's generate_autoinstall(obj_identifier, obj_type, obj_field, autoinstaller_file, autoinstaller_subfile) takes 5 positional args. The Go client was passing only (profile, system) — mapping them to obj_identifier and obj_type while ignoring obj_field and the two optional file overrides. Update GenerateAutoinstall to accept all 5 parameters. Update the test call site and request fixture to match the new signature. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BackgroundSignatureReload wraps background_signature_reload to reload OS detection signatures from disk. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ecfd5d9 to
ffd9506
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #81
This PR adds compatibility with the upcoming 4.0.0 release.