feat: StorageProvider auto-selection on StorageClient API #6
Labels
No labels
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: cleverlibre/clevercloud-storage#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/storage_auto_selection-#5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ISSUES CLOSED: #5
c0e8dec04b
to7caa68abb6
Many of the code changes here are not complete repetitions, but are still very similar to one another. It might be more maintainable to define a function like:
Then you can call:
list(self._execute_func_on_provider('list_files', path, recursive))
inlist_files
self._execute_func_on_provider('file_exists', path)
infile_exists
self._execute_func_on_provider('get_file_size', path)
inget_file_size
and so on.
@ -38,0 +59,4 @@
else:
source_provider = StorageClientFactory.get_provider_for_path(path)
return self.provider if source_provider is None else source_provider
Idiomatic Python might prefer
return source_provider or self.provider
I will take note of those suggestions for later, but i have some urgency on getting this merged, as CleverSwarm Endpoints S3 support depends on this.
Regarding the first suggestion yes, it makes the code more maintainable, however the code repetition is not that large and it may be easier to track in debug sessions. If a bug comes up in that particular section i will consider refactoring it your way.
As for the second, you are also right, i will probably open an issue with this suggestions.