diff --git a/virtweb_backend/src/libvirt_client.rs b/virtweb_backend/src/libvirt_client.rs index 7adefdb..9cbe77c 100644 --- a/virtweb_backend/src/libvirt_client.rs +++ b/virtweb_backend/src/libvirt_client.rs @@ -117,7 +117,9 @@ impl LibVirtClient { out.insert(g); } } - Ok(out.into_iter().collect()) + let mut out: Vec<_> = out.into_iter().collect(); + out.sort(); + Ok(out) } /// Update a network configuration diff --git a/virtweb_backend/src/libvirt_rest_structures/vm.rs b/virtweb_backend/src/libvirt_rest_structures/vm.rs index 4ce4118..6543644 100644 --- a/virtweb_backend/src/libvirt_rest_structures/vm.rs +++ b/virtweb_backend/src/libvirt_rest_structures/vm.rs @@ -10,7 +10,9 @@ use crate::utils::files_utils::convert_size_unit_to_mb; use lazy_regex::regex; use num::Integer; -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, Hash)] +#[derive( + Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, Hash, Ord, PartialOrd, +)] pub struct VMGroupId(pub String); #[derive(serde::Serialize, serde::Deserialize)]