Skip to content

Commit

Permalink
Fix logic in initialization examples for FTS3 plug-ins (#382)
Browse files Browse the repository at this point in the history
The previous order is incorrect and causes Rucio to crash:

```
packages/rucio/transfertool/fts3_plugins.py", line 55, in __init__
    raise ValueError(f'Policy Algorithm {policy_algorithm} not found')
ValueError: Policy Algorithm activity not found
```
  • Loading branch information
rdimaio authored Nov 14, 2024
1 parent 818e80c commit 7fc7526
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/operator/transfers/configure_fts3_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ from rucio.transfertool.fts3_plugins import FTS3TapeMetadataPlugin

class ExperimentFTSPlugins(FTS3TapeMetadataPlugin):
def __init__(self, policy_algorithm="def"):
super().__init__(policy_algorithm)
self.register("policy_algorithm", func=self.plugin_algorithm) # Name and function for the new algorithm
super().__init__(policy_algorithm)

def plugin_algorithm(self, *hints): # Code executed at runtime
return {"storage_location": "this_location"}
Expand Down Expand Up @@ -63,11 +63,11 @@ from rucio.transfertool.fts3_plugins import FTS3TapeMetadataPlugin

class ExperimentFTSPlugins(FTS3TapeMetadataPlugin):
def __init__(self, policy_algorithm="def"):
super().__init__(policy_algorithm)
self.register(
"policy_algorithm",
func=self.plugin_algorithm,
init_func=self.plugin_initialization)
super().__init__(policy_algorithm)

def plugin_algorithm(self, *hints):
# Can use `self.extra_params`
Expand Down

0 comments on commit 7fc7526

Please sign in to comment.