Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
slapos.toolbox
Commits
0191b857
Commit
0191b857
authored
Nov 07, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resilient: new entry point for slaprunner's post-notification-run
parent
2adbc5c1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
setup.py
setup.py
+1
-0
slapos/resilient/runner_importer.py
slapos/resilient/runner_importer.py
+34
-0
No files found.
setup.py
View file @
0191b857
...
...
@@ -112,6 +112,7 @@ setup(name=name,
'qemu-qmp-client = slapos.qemuqmpclient:main'
,
'rdiffbackup.genstatrss = slapos.resilient.rdiffBackupStat2RSS:main'
,
'runner-exporter = slapos.resilient.runner_exporter:runExport'
,
'runner-importer-post-notification-run = slapos.resilient.runner_importer:postNotificationRun'
,
'securedelete = slapos.securedelete:main'
,
'slapos-kill = slapos.systool:kill'
,
'slaprunnertest = slapos.runner.runnertest:main'
,
...
...
slapos/resilient/runner_importer.py
0 → 100644
View file @
0191b857
from
__future__
import
print_function
import
argparse
import
subprocess
from
.runner_utils
import
*
def
parsePostNotificationRunArgumentList
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'--srv-path'
,
required
=
True
)
parser
.
add_argument
(
'--backup-path'
,
required
=
True
)
parser
.
add_argument
(
'--diff-file'
,
required
=
True
)
parser
.
add_argument
(
'--proof-signature-file'
,
required
=
True
)
return
parser
.
parse_args
()
def
postNotificationRun
():
args
=
parsePostNotificationRunArgumentList
()
runner_working_path
=
os
.
path
.
join
(
args
.
srv_path
,
'runner'
)
with
CwdContextManager
(
runner_working_path
):
slappart_signature_method_dict
=
getSlappartSignatureMethodDict
()
with
CwdContextManager
(
args
.
backup_path
):
writeSignatureFile
(
slappart_signature_method_dict
,
runner_working_path
,
args
.
proof_signature_file
)
try
:
diff_output
=
subprocess
.
check_output
([
'diff'
,
'-ruw'
,
'backup.signature'
,
args
.
proof_signature_file
])
except
subprocess
.
CalledProcessError
as
e
:
diff_output
=
e
.
output
finally
:
with
open
(
args
.
diff_file
,
'w'
)
as
f
:
f
.
write
(
diff_output
)
Write
Preview
Markdown
is supported
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