Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
ldv_datamanagement_tasks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LDV
ldv_datamanagement_tasks
Commits
b40946fe
Commit
b40946fe
authored
2 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
Fix user friendliness
parent
3cefa993
No related branches found
No related tags found
1 merge request
!10
Implement pruning mechanism for the utils script
Pipeline
#39313
passed with warnings
2 years ago
Stage: lint
Stage: test
Stage: package
Stage: integration
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
atdb/main.py
+5
-3
5 additions, 3 deletions
atdb/main.py
atdb/prune.py
+4
-1
4 additions, 1 deletion
atdb/prune.py
with
9 additions
and
4 deletions
atdb/main.py
+
5
−
3
View file @
b40946fe
...
...
@@ -23,10 +23,12 @@ def read_conf_file(args: Namespace, additional_location=None):
"""
parser
=
ConfigParser
()
if
additional_location
is
not
None
:
parser
.
read
(
additional_location
)
read_files
=
parser
.
read
(
additional_location
)
else
:
parser
.
read
(
DEFAULT_PATH
)
read_files
=
parser
.
read
(
DEFAULT_PATH
)
if
not
read_files
and
(
args
.
atdb_site
is
None
or
args
.
token
is
None
):
raise
SystemError
(
'
Missing configuration file
'
)
global_config
=
parser
[
"
ATDB
"
]
if
"
url
"
in
global_config
:
args
.
atdb_site
=
parser
[
"
ATDB
"
][
"
url
"
]
...
...
@@ -35,7 +37,7 @@ def read_conf_file(args: Namespace, additional_location=None):
return
args
def
parse_args
()
->
Namespace
:
def
parse_args
()
->
(
Namespace
,
ArgumentParser
)
:
"""
Parse command line arguments
"""
...
...
This diff is collapsed.
Click to expand it.
atdb/prune.py
+
4
−
1
View file @
b40946fe
...
...
@@ -88,4 +88,7 @@ def prune(args):
)
remove_surl_locations
(
surls_to_remove
,
dry_run
=
args
.
dry_run
)
if
args
.
dry_run
:
logger
.
info
(
"
[dry-run] Successfully removed %s files
"
,
len
(
surls_to_remove
))
else
:
logger
.
info
(
"
Successfully removed %s files
"
,
len
(
surls_to_remove
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment