Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos
Commits
8e2b1604
Commit
8e2b1604
authored
Nov 08, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
theia resiliency
parent
d9b411da
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
software/theia/test/test_resiliency.py
software/theia/test/test_resiliency.py
+2
-2
software/theia/theia_common.py
software/theia/theia_common.py
+3
-0
software/theia/theia_import.py
software/theia/theia_import.py
+2
-1
No files found.
software/theia/test/test_resiliency.py
View file @
8e2b1604
...
@@ -435,8 +435,8 @@ class TestTheiaExportAndImport(ResilienceMixin, ExportAndImportMixin, ResilientT
...
@@ -435,8 +435,8 @@ class TestTheiaExportAndImport(ResilienceMixin, ExportAndImportMixin, ResilientT
self
.
checkLog
(
os
.
path
.
join
(
dummy_root
,
'log.log'
),
self
.
initial_log
,
newline
=
None
)
self
.
checkLog
(
os
.
path
.
join
(
dummy_root
,
'log.log'
),
self
.
initial_log
,
newline
=
None
)
# Check that the non ascii filename has been correctly propagated
# Check that the non ascii filename has been correctly propagated
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
getPartitionPath
(
'import'
,
'srv'
,
'project'
),
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
getPartitionPath
(
'import'
,
'srv'
,
'project'
),
non_ascii_only_filename
))
non_ascii_only_filename
))
)
# Check that ~/srv/.backup_identity_script was detected and called
# Check that ~/srv/.backup_identity_script was detected and called
signature
=
self
.
getPartitionPath
(
signature
=
self
.
getPartitionPath
(
...
...
software/theia/theia_common.py
View file @
8e2b1604
...
@@ -7,6 +7,7 @@ import re
...
@@ -7,6 +7,7 @@ import re
import
shutil
import
shutil
import
subprocess
as
sp
import
subprocess
as
sp
import
sqlite3
import
sqlite3
from
base64
import
urlsafe_b64encode
import
six
import
six
import
zc.buildout.configparser
import
zc.buildout.configparser
...
@@ -113,6 +114,7 @@ def fast_hashwalk(root_dir):
...
@@ -113,6 +114,7 @@ def fast_hashwalk(root_dir):
filepath
=
os
.
path
.
join
(
dirpath
,
f
)
filepath
=
os
.
path
.
join
(
dirpath
,
f
)
if
os
.
path
.
isfile
(
filepath
):
if
os
.
path
.
isfile
(
filepath
):
displaypath
=
os
.
path
.
relpath
(
filepath
,
start
=
root_dir
)
displaypath
=
os
.
path
.
relpath
(
filepath
,
start
=
root_dir
)
displaypath
=
urlsafe_b64encode
(
displaypath
.
encode
()).
decode
()
yield
'%s %s'
%
(
sha256sum
(
filepath
),
displaypath
)
yield
'%s %s'
%
(
sha256sum
(
filepath
),
displaypath
)
...
@@ -124,6 +126,7 @@ def exclude_hashwalk(root_dir, instance_dir):
...
@@ -124,6 +126,7 @@ def exclude_hashwalk(root_dir, instance_dir):
filepath
=
os
.
path
.
join
(
dirpath
,
f
)
filepath
=
os
.
path
.
join
(
dirpath
,
f
)
if
os
.
path
.
isfile
(
filepath
):
if
os
.
path
.
isfile
(
filepath
):
displaypath
=
os
.
path
.
relpath
(
filepath
,
start
=
root_dir
)
displaypath
=
os
.
path
.
relpath
(
filepath
,
start
=
root_dir
)
displaypath
=
urlsafe_b64encode
(
displaypath
.
encode
()).
decode
()
yield
'%s %s'
%
(
sha256sum
(
filepath
),
displaypath
)
yield
'%s %s'
%
(
sha256sum
(
filepath
),
displaypath
)
if
dirpath
==
instance_dir
:
if
dirpath
==
instance_dir
:
remaining_dirs
=
[]
remaining_dirs
=
[]
...
...
software/theia/theia_import.py
View file @
8e2b1604
...
@@ -6,6 +6,7 @@ import sys
...
@@ -6,6 +6,7 @@ import sys
import
subprocess
as
sp
import
subprocess
as
sp
import
time
import
time
import
traceback
import
traceback
from
base64
import
urlsafe_b64decode
import
requests
import
requests
from
requests.exceptions
import
RequestException
from
requests.exceptions
import
RequestException
...
@@ -110,7 +111,7 @@ class TheiaImport(object):
...
@@ -110,7 +111,7 @@ class TheiaImport(object):
except
ValueError
:
except
ValueError
:
yield
'Could not parse: %s'
%
line
yield
'Could not parse: %s'
%
line
continue
continue
filepath
=
os
.
path
.
join
(
root_dir
,
relpath
)
filepath
=
os
.
path
.
join
(
root_dir
,
urlsafe_b64decode
(
relpath
).
decode
()
)
try
:
try
:
signature
=
sha256sum
(
filepath
)
signature
=
sha256sum
(
filepath
)
except
IOError
:
except
IOError
:
...
...
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