From f2b1c98ca1fc5e865dad6ed8bf18091cab55cba8 Mon Sep 17 00:00:00 2001 From: Erdem Meydanli Date: Tue, 6 Aug 2024 13:31:35 +0000 Subject: [PATCH] agent: enable post-sync actions for ManagedToken::add This commit changes agent's behavior to process post-sync actions and restarts the webserver if necessary. Signed-off-by: Erdem Meydanli --- src/vtok_agent/src/agent/mngtok.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vtok_agent/src/agent/mngtok.rs b/src/vtok_agent/src/agent/mngtok.rs index be812fb..eb5abd2 100644 --- a/src/vtok_agent/src/agent/mngtok.rs +++ b/src/vtok_agent/src/agent/mngtok.rs @@ -343,21 +343,21 @@ impl ManagedToken { Ok(()) } - fn add(&mut self) -> Result<(), Error> { + fn add(&mut self) -> Result, Error> { self.enclave .add_token(self.to_schema_token()?) .map_err(Error::EnclaveError)? .map_err(Error::AddTokenError)?; - self.satisfy_target(true).or_else(|e| { + return self.satisfy_target(true).or_else(|e| { error!( "Unable to satisfy target for token {}: {:?}", self.label.as_str(), e ); Ok(None) - })?; + }); - Ok(()) + Ok(None) } pub fn sync(&mut self) -> Result, Error> { @@ -381,7 +381,7 @@ impl ManagedToken { } (false, _) => { debug!("Adding token: {}.", self.label.as_str()); - self.add()?; + return self.add(); } }