Commit 2dcbe51a authored by Romain Courteaud's avatar Romain Courteaud 🐙

Revert "WIP: theia: resiliency of a non ascii only filename"

This reverts commit 03a82809aebbddc7e80a9e4775ff0190eab8fe62.
parent 77ff2b8d
......@@ -39,7 +39,7 @@ md5sum = 3572b3fa458505ae25ebcea9b1ed3267
[theia-common]
_update_hash_filename_ = theia_common.py
md5sum = 11a441d364147d4ed95cb7193e161a8e
md5sum = 6a25c6a7f1beb27232a3c9acd8a76500
[theia-export]
_update_hash_filename_ = theia_export.py
......@@ -47,7 +47,7 @@ md5sum = bc58b7191243bce2bbc95696abce9ef8
[theia-import]
_update_hash_filename_ = theia_import.py
md5sum = 6c820e9c76fea5cff5636f6eb9b095fa
md5sum = 43720e0bf8487ae6bd7e7c462ea5c9f6
[slapos.css.in]
_update_hash_filename_ = slapos.css.in
......
......@@ -50,7 +50,6 @@ from test import TheiaTestCase, ResilientTheiaMixin, theia_software_release_url
dummy_software_url = os.path.abspath(
os.path.join('resilience_dummy', 'software.cfg'))
non_ascii_only_filename = ' 🙊 \t nonascii \n $ \r é '
class WorkaroundSnapshotConflict(TheiaTestCase):
......@@ -422,11 +421,6 @@ class TestTheiaResilienceImportAndExport(ResilienceMixin, ExportAndImportMixin,
# Check that dummy instance was properly deployed
self.initial_log = self.checkLog(os.path.join(dummy_root, 'log.log'))
# Create a non ascii filename, to ensure signature correctly handles it
self.writeFile(os.path.join(self.getPartitionPath('export', 'srv', 'project'),
non_ascii_only_filename),
'This file should be included in resilient backup')
# Create ~/include and ~/include/included
self.writeFile(os.path.join(dummy_root, 'include', 'included'),
'This file should be included in resilient backup')
......@@ -468,10 +462,6 @@ class TestTheiaResilienceImportAndExport(ResilienceMixin, ExportAndImportMixin,
# Check that the dummy instance is not yet started
self.checkLog(os.path.join(dummy_root, 'log.log'), self.initial_log, newline=None)
# Check that the non ascii filename has been correctly propagated
self.assertTrue(os.path.exists(os.path.join(self.getPartitionPath('import', 'srv', 'project'),
non_ascii_only_filename)))
# Check that ~/srv/.backup_identity_script was detected and called
signature = self.getPartitionPath(
'import', 'srv', 'backup', 'theia', 'slappart0.backup.signature.custom')
......
......@@ -7,7 +7,6 @@ import re
import shutil
import subprocess as sp
import sqlite3
from base64 import urlsafe_b64encode
import six
import zc.buildout.configparser
......@@ -114,7 +113,6 @@ def fast_hashwalk(root_dir):
filepath = os.path.join(dirpath, f)
if os.path.isfile(filepath):
displaypath = os.path.relpath(filepath, start=root_dir)
displaypath = urlsafe_b64encode(displaypath.encode()).decode()
yield '%s %s' % (sha256sum(filepath), displaypath)
......@@ -126,7 +124,6 @@ def exclude_hashwalk(root_dir, instance_dir):
filepath = os.path.join(dirpath, f)
if os.path.isfile(filepath):
displaypath = os.path.relpath(filepath, start=root_dir)
displaypath = urlsafe_b64encode(displaypath.encode()).decode()
yield '%s %s' % (sha256sum(filepath), displaypath)
if dirpath == instance_dir:
remaining_dirs = []
......
......@@ -6,7 +6,6 @@ import sys
import subprocess as sp
import time
import traceback
from base64 import urlsafe_b64decode
import requests
from requests.exceptions import RequestException
......@@ -120,7 +119,7 @@ class TheiaImport(object):
except ValueError:
yield 'Could not parse: %s' % line
continue
filepath = os.path.join(root_dir, urlsafe_b64decode(relpath).decode())
filepath = os.path.join(root_dir, relpath)
try:
signature = sha256sum(filepath)
except IOError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment