diff --git a/src/allmydata/client.py b/src/allmydata/client.py index ad5e61c14..50ceb448f 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -31,13 +31,11 @@ from allmydata.util.abbreviate import parse_abbreviated_size from allmydata.util.time_format import parse_duration, parse_date from allmydata.util.i2p_provider import create as create_i2p_provider from allmydata.util.tor_provider import create as create_tor_provider -from allmydata.util.base32 import a2b, b2a from allmydata.stats import StatsProvider from allmydata.history import History from allmydata.interfaces import IStatsProducer, SDMF_VERSION, MDMF_VERSION, DEFAULT_MAX_SEGMENT_SIZE from allmydata.nodemaker import NodeMaker from allmydata.blacklist import Blacklist -from allmydata import node KiB=1024 diff --git a/src/allmydata/scripts/admin.py b/src/allmydata/scripts/admin.py index 0a641728c..ef1059a31 100644 --- a/src/allmydata/scripts/admin.py +++ b/src/allmydata/scripts/admin.py @@ -72,7 +72,7 @@ class AddGridManagerCertOptions(BaseOptions): "Must provide --filename option" ) if self['filename'] == '-': - print >>self.parent.parent.stderr, "reading certificate from stdin" + print("reading certificate from stdin", file=self.parent.parent.stderr) data = sys.stdin.read() if len(data) == 0: raise usage.UsageError( @@ -82,7 +82,7 @@ class AddGridManagerCertOptions(BaseOptions): try: self.certificate_data = parse_grid_manager_data(data) except ValueError as e: - print >>self.parent.parent.stderr, "Error parsing certificate: {}".format(e) + print("Error parsing certificate: {}".format(e), file=self.parent.parent.stderr) self.certificate_data = None else: with open(self['filename'], 'r') as f: @@ -118,10 +118,10 @@ def add_grid_manager_cert(options): cert_fname = "{}.cert".format(options['name']) cert_path = config.get_config_path(cert_fname) cert_bytes = json.dumps(options.certificate_data, indent=4) + '\n' - cert_name = options['name'] + # cert_name = options['name'] if exists(cert_path): - print >>options.parent.parent.stderr, "Already have file '{}'".format(cert_path) + print("Already have file '{}'".format(cert_path), file=options.parent.parent.stderr) return 1 cfg = config.config # why aren't methods we call on cfg in _Config itself? @@ -141,7 +141,7 @@ def add_grid_manager_cert(options): cfg.write(f) # print("wrote {}".format(config_fname)) - print >>options.parent.parent.stderr, "There are now {} certificates".format(len(gm_certs)) + print("There are now {} certificates".format(len(gm_certs)), file=options.parent.parent.stderr) return 0 diff --git a/src/allmydata/scripts/tahoe_grid_manager.py b/src/allmydata/scripts/tahoe_grid_manager.py index f7193cbf2..b33552861 100644 --- a/src/allmydata/scripts/tahoe_grid_manager.py +++ b/src/allmydata/scripts/tahoe_grid_manager.py @@ -1,5 +1,5 @@ +from __future__ import print_function -import os import sys import json import time diff --git a/src/allmydata/storage_client.py b/src/allmydata/storage_client.py index 53b0d5c53..5f65c6cec 100644 --- a/src/allmydata/storage_client.py +++ b/src/allmydata/storage_client.py @@ -43,7 +43,6 @@ from pycryptopp.publickey import ed25519 # perhaps NaCl instead? other code use from allmydata.interfaces import IStorageBroker, IDisplayableServer, IServer from allmydata.util import log, base32, connection_status -from allmydata.util import keyutil from allmydata.util.assertutil import precondition from allmydata.util.observer import ObserverList from allmydata.util.rrefutil import add_version_to_remote_reference @@ -304,7 +303,7 @@ def parse_grid_manager_data(gm_data): k, ) ) - for k in allowed_keys: + for k in required_keys: if k not in js: raise ValueError( "Grid Manager certificate JSON must contain '{}'".format(