public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] sync: fix source store+namespace printing
@ 2023-11-30 10:50 Fabian Grünbichler
  2023-11-30 10:57 ` Dominik Csapak
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabian Grünbichler @ 2023-11-30 10:50 UTC (permalink / raw)
  To: pbs-devel

previously this would always refer to the "top" namespace of the source,
instead of properly iterating over the namespace tree. adapt the trait
accordingly, since this was the only call site.

this fixes a cosmetic issue only.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
 src/server/pull.rs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/server/pull.rs b/src/server/pull.rs
index 44d428fd..3b71c156 100644
--- a/src/server/pull.rs
+++ b/src/server/pull.rs
@@ -91,7 +91,7 @@ trait PullSource: Send + Sync {
         worker: &WorkerTask,
     ) -> Result<Vec<BackupDir>, Error>;
     fn get_ns(&self) -> BackupNamespace;
-    fn print_store_and_ns(&self) -> String;
+    fn get_store(&self) -> &str;
 
     /// Returns a reader for reading data from a specific backup directory.
     async fn reader(
@@ -229,8 +229,8 @@ impl PullSource for RemoteSource {
         self.ns.clone()
     }
 
-    fn print_store_and_ns(&self) -> String {
-        print_store_and_ns(self.repo.store(), &self.ns)
+    fn get_store(&self) -> &str {
+        &self.repo.store()
     }
 
     async fn reader(
@@ -299,8 +299,8 @@ impl PullSource for LocalSource {
         self.ns.clone()
     }
 
-    fn print_store_and_ns(&self) -> String {
-        print_store_and_ns(self.store.name(), &self.ns)
+    fn get_store(&self) -> &str {
+        self.store.name()
     }
 
     async fn reader(
@@ -1269,7 +1269,7 @@ pub(crate) async fn pull_store(
     let mut synced_ns = HashSet::with_capacity(namespaces.len());
 
     for namespace in namespaces {
-        let source_store_ns_str = params.source.print_store_and_ns();
+        let source_store_ns_str = print_store_and_ns(params.source.get_store(), &namespace);
 
         let target_ns = namespace.map_prefix(&params.source.get_ns(), &params.target.ns)?;
         let target_store_ns_str = print_store_and_ns(params.target.store.name(), &target_ns);
-- 
2.39.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup] sync: fix source store+namespace printing
  2023-11-30 10:50 [pbs-devel] [PATCH proxmox-backup] sync: fix source store+namespace printing Fabian Grünbichler
@ 2023-11-30 10:57 ` Dominik Csapak
  2023-11-30 10:57 ` [pbs-devel] applied: " Thomas Lamprecht
  2023-11-30 11:01 ` [pbs-devel] " Philipp Hufnagl
  2 siblings, 0 replies; 4+ messages in thread
From: Dominik Csapak @ 2023-11-30 10:57 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Fabian Grünbichler

works as intended, correct source namespace is now displayed:

Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup] sync: fix source store+namespace printing
  2023-11-30 10:50 [pbs-devel] [PATCH proxmox-backup] sync: fix source store+namespace printing Fabian Grünbichler
  2023-11-30 10:57 ` Dominik Csapak
@ 2023-11-30 10:57 ` Thomas Lamprecht
  2023-11-30 11:01 ` [pbs-devel] " Philipp Hufnagl
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2023-11-30 10:57 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Fabian Grünbichler

Am 30/11/2023 um 11:50 schrieb Fabian Grünbichler:
> previously this would always refer to the "top" namespace of the source,
> instead of properly iterating over the namespace tree. adapt the trait
> accordingly, since this was the only call site.
> 
> this fixes a cosmetic issue only.
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> ---
>  src/server/pull.rs | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup] sync: fix source store+namespace printing
  2023-11-30 10:50 [pbs-devel] [PATCH proxmox-backup] sync: fix source store+namespace printing Fabian Grünbichler
  2023-11-30 10:57 ` Dominik Csapak
  2023-11-30 10:57 ` [pbs-devel] applied: " Thomas Lamprecht
@ 2023-11-30 11:01 ` Philipp Hufnagl
  2 siblings, 0 replies; 4+ messages in thread
From: Philipp Hufnagl @ 2023-11-30 11:01 UTC (permalink / raw)
  To: pbs-devel

Fixes the Issue in both directions, LGTM

Tested-by: Philipp Hufnagl <p.hufnagl@proxmox.com>

On 11/30/23 11:50, Fabian Grünbichler wrote:
> previously this would always refer to the "top" namespace of the source,
> instead of properly iterating over the namespace tree. adapt the trait
> accordingly, since this was the only call site.
> 
> this fixes a cosmetic issue only.
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> ---
>  src/server/pull.rs | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/server/pull.rs b/src/server/pull.rs
> index 44d428fd..3b71c156 100644
> --- a/src/server/pull.rs
> +++ b/src/server/pull.rs
> @@ -91,7 +91,7 @@ trait PullSource: Send + Sync {
>          worker: &WorkerTask,
>      ) -> Result<Vec<BackupDir>, Error>;
>      fn get_ns(&self) -> BackupNamespace;
> -    fn print_store_and_ns(&self) -> String;
> +    fn get_store(&self) -> &str;
>  
>      /// Returns a reader for reading data from a specific backup directory.
>      async fn reader(
> @@ -229,8 +229,8 @@ impl PullSource for RemoteSource {
>          self.ns.clone()
>      }
>  
> -    fn print_store_and_ns(&self) -> String {
> -        print_store_and_ns(self.repo.store(), &self.ns)
> +    fn get_store(&self) -> &str {
> +        &self.repo.store()
>      }
>  
>      async fn reader(
> @@ -299,8 +299,8 @@ impl PullSource for LocalSource {
>          self.ns.clone()
>      }
>  
> -    fn print_store_and_ns(&self) -> String {
> -        print_store_and_ns(self.store.name(), &self.ns)
> +    fn get_store(&self) -> &str {
> +        self.store.name()
>      }
>  
>      async fn reader(
> @@ -1269,7 +1269,7 @@ pub(crate) async fn pull_store(
>      let mut synced_ns = HashSet::with_capacity(namespaces.len());
>  
>      for namespace in namespaces {
> -        let source_store_ns_str = params.source.print_store_and_ns();
> +        let source_store_ns_str = print_store_and_ns(params.source.get_store(), &namespace);
>  
>          let target_ns = namespace.map_prefix(&params.source.get_ns(), &params.target.ns)?;
>          let target_store_ns_str = print_store_and_ns(params.target.store.name(), &target_ns);




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-30 11:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-30 10:50 [pbs-devel] [PATCH proxmox-backup] sync: fix source store+namespace printing Fabian Grünbichler
2023-11-30 10:57 ` Dominik Csapak
2023-11-30 10:57 ` [pbs-devel] applied: " Thomas Lamprecht
2023-11-30 11:01 ` [pbs-devel] " Philipp Hufnagl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal