Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ActEV
diva_evaluation_cli
Commits
4916de07
Commit
4916de07
authored
Feb 22, 2019
by
Alexandre Boyer
Browse files
add clear-logs command
parent
3fbc2355
Pipeline
#130711
passed with stage
in 27 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
diva_evaluation_cli/bin/cli.py
View file @
4916de07
...
...
@@ -23,13 +23,15 @@ from diva_evaluation_cli.bin.commands.actev_merge_chunks import ActevMergeChunks
from
diva_evaluation_cli.bin.commands.actev_exec
import
ActevExec
from
diva_evaluation_cli.bin.commands.actev_status
import
ActevStatus
from
diva_evaluation_cli.bin.commands.actev_validate_execution
import
ActevValidateExecution
from
diva_evaluation_cli.bin.commands.actev_clear_logs
import
ActevClearLogs
private_subcommands
=
[
ActevGetSystem
(),
ActevValidateSystem
(),
ActevExec
(),
ActevStatus
(),
ActevValidateExecution
()
ActevValidateExecution
(),
ActevClearLogs
()
]
public_subcommands
=
[
...
...
diva_evaluation_cli/bin/commands/actev_clear_logs.py
0 → 100644
View file @
4916de07
"""Actev module: system-setup
Actev modules are used to parse actev commands in order to get arguments
before calling associated entry point methods to execute systems.
Warning: this file should not be modified: see src/entry_points to add your source code.
"""
import
logging
from
diva_evaluation_cli.bin.commands.actev_command
import
ActevCommand
from
diva_evaluation_cli.bin.private_src.entry_points.actev_clear_logs
import
entry_point
class
ActevClearLogs
(
ActevCommand
):
"""Delete temporary files as resource and status monitoring files.
"""
def
__init__
(
self
):
super
(
ActevClearLogs
,
self
).
__init__
(
'clear-logs'
,
entry_point
)
def
cli_parser
(
self
,
arg_parser
):
"""Configure the description and the arguments (positional and optional) to parse.
Args:
arg_parser(:obj:`ArgParser`): Python arg parser to describe how to parse the command
"""
arg_parser
.
description
=
"Delete temporary files as resource and status monitoring files"
arg_parser
.
set_defaults
(
func
=
ActevClearLogs
.
command
,
object
=
self
)
diva_evaluation_cli/bin/private_src/entry_points/actev_clear_logs.py
0 → 100644
View file @
4916de07
"""Entry point module: exec
This file should not be modified.
"""
import
os
def
entry_point
():
"""Private entry point.
Delete temporary files as resource and status monitoring files.
"""
# go into the right directory to execute the script
path
=
os
.
path
.
dirname
(
__file__
)
script
=
os
.
path
.
join
(
path
,
'../implementation/clear_logs/clear_logs.sh'
)
# execute the script
# status is the exit status code returned by the program
status
=
os
.
system
(
script
)
if
status
!=
0
:
raise
Exception
(
"Error occured in clear_logs.sh"
)
diva_evaluation_cli/bin/private_src/implementation/clear_logs/clear_logs.sh
0 → 100755
View file @
4916de07
#!/bin/bash
CURRENT_DIR
=
$(
dirname
$0
)
/../..
for
LOG
in
`
find
$CURRENT_DIR
-type
f |
grep
"_monitoring.json"
`
;
do
rm
$LOG
echo
"
$LOG
deleted"
done
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment