mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-18 15:28:12 +00:00
Merge branch 'master' into 2916.grid-manager-proposal.5
This commit is contained in:
@ -1,4 +1,16 @@
|
||||
from past.builtins import unicode
|
||||
"""
|
||||
Ported to Python 3.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from future.utils import PY2
|
||||
if PY2:
|
||||
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, max, min # noqa: F401
|
||||
# Don't use future str to prevent leaking future's newbytes into foolscap, which they break.
|
||||
from past.builtins import unicode as str
|
||||
|
||||
import os
|
||||
import stat
|
||||
@ -371,8 +383,8 @@ class _StoragePlugins(object):
|
||||
"""
|
||||
return set(
|
||||
config.get_config(
|
||||
"storage", "plugins", b""
|
||||
).decode("ascii").split(u",")
|
||||
"storage", "plugins", ""
|
||||
).split(u",")
|
||||
) - {u""}
|
||||
|
||||
@classmethod
|
||||
@ -467,7 +479,7 @@ def create_introducer_clients(config, main_tub, _introducer_factory=None):
|
||||
|
||||
introducers = config.get_introducer_configuration()
|
||||
|
||||
for petname, (furl, cache_path) in introducers.items():
|
||||
for petname, (furl, cache_path) in list(introducers.items()):
|
||||
ic = _introducer_factory(
|
||||
main_tub,
|
||||
furl.encode("ascii"),
|
||||
@ -687,7 +699,7 @@ class _Client(node.Node, pollmixin.PollMixin):
|
||||
def init_secrets(self):
|
||||
# configs are always unicode
|
||||
def _unicode_make_secret():
|
||||
return unicode(_make_secret(), "ascii")
|
||||
return str(_make_secret(), "ascii")
|
||||
lease_s = self.config.get_or_create_private_config(
|
||||
"secret", _unicode_make_secret).encode("utf-8")
|
||||
lease_secret = base32.a2b(lease_s)
|
||||
@ -702,7 +714,7 @@ class _Client(node.Node, pollmixin.PollMixin):
|
||||
def _make_key():
|
||||
private_key, _ = ed25519.create_signing_keypair()
|
||||
# Config values are always unicode:
|
||||
return unicode(ed25519.string_from_signing_key(private_key) + b"\n", "utf-8")
|
||||
return str(ed25519.string_from_signing_key(private_key) + b"\n", "utf-8")
|
||||
|
||||
private_key_str = self.config.get_or_create_private_config(
|
||||
"node.privkey", _make_key).encode("utf-8")
|
||||
@ -890,7 +902,7 @@ class _Client(node.Node, pollmixin.PollMixin):
|
||||
"""
|
||||
Register a storage server.
|
||||
"""
|
||||
config_key = b"storage-plugin.{}.furl".format(
|
||||
config_key = "storage-plugin.{}.furl".format(
|
||||
# Oops, why don't I have a better handle on this value?
|
||||
announceable_storage_server.announcement[u"name"],
|
||||
)
|
||||
|
Reference in New Issue
Block a user