Skip to content
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

Always use XML builders to construct XML #135

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

ekohl
Copy link
Contributor

@ekohl ekohl commented Dec 21, 2023

This removes the use of ERB to construct XML and instead always uses a builder.

The primary motivation was that the ERB invocation was raising an error and an XML builder guarantees valid XML. While doing this I figured out that at least Pool doesn't have a .to_xml and Network.to_xml was just broken. Pool.to_xml does work, but it is noted in the docs (https://libvirt.org/formatstorage.html) that some fileds (allocation, capacity & available) are not applicable when creating a pool so it's questionable if they should be included.

Given that, I question if anyone actually uses this in practice, so I'm not too worried about breaking things.

@@ -27,6 +27,17 @@ def save
def shutdown
service.destroy_network(uuid)
end

def to_xml
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Further testing told me save isn't even implemented now so I'm not too worried about this.

The Pool class doesn't have a to_xml method so this is unused.
This removes the use of ERB to construct XML and instead always uses a
builder.
@ekohl ekohl force-pushed the drop-erb-template-rendering branch from 738f4ef to 476c630 Compare July 15, 2024 15:27
@ekohl ekohl merged commit 476c630 into fog:master Jul 15, 2024
6 of 7 checks passed
@ekohl ekohl deleted the drop-erb-template-rendering branch July 15, 2024 15:56
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.

1 participant