From fb9ee7ec124b207283e475ca337d60acf7d16ca1 Mon Sep 17 00:00:00 2001 From: Greg Colombo Date: Mon, 26 Aug 2024 21:20:19 +0000 Subject: [PATCH] PR feedback --- nexus/src/app/instance.rs | 4 ++-- sled-agent/src/instance_manager.rs | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/nexus/src/app/instance.rs b/nexus/src/app/instance.rs index ed0a8443b9..b715b6bbd3 100644 --- a/nexus/src/app/instance.rs +++ b/nexus/src/app/instance.rs @@ -1830,8 +1830,8 @@ impl super::Nexus { } } -/// Publishes the VMM and migration state supplied in `new_runtime_state` to the -/// database. +/// Writes the VMM and migration state supplied in `new_runtime_state` to the +/// database (provided that it's newer than what's already there). /// /// # Return value /// diff --git a/sled-agent/src/instance_manager.rs b/sled-agent/src/instance_manager.rs index 353496a060..24be8be89f 100644 --- a/sled-agent/src/instance_manager.rs +++ b/sled-agent/src/instance_manager.rs @@ -733,11 +733,9 @@ impl InstanceManagerRunner { // name to capture into a bundle, so return a `NoSuchZone` error. let vmm_id: PropolisUuid = name .strip_prefix(PROPOLIS_ZONE_PREFIX) - .ok_or_else(|| BundleError::NoSuchZone { name: name.to_string() }) - .and_then(|uuid_str| { - uuid_str.parse::().map_err(|_| { - BundleError::NoSuchZone { name: name.to_string() } - }) + .and_then(|uuid_str| uuid_str.parse::().ok()) + .ok_or_else(|| BundleError::NoSuchZone { + name: name.to_string(), })?; let Some(instance) = self.jobs.get(&vmm_id) else {