get_app_version -> global function

This commit is contained in:
meejah 2018-02-13 18:57:49 -07:00
parent 35810a5692
commit f37ab3b12d
2 changed files with 7 additions and 5 deletions

View File

@ -30,6 +30,7 @@ from allmydata.nodemaker import NodeMaker
from allmydata.blacklist import Blacklist
from allmydata.node import OldConfigOptionError, _common_config_sections
from allmydata.node import read_config
from allmydata.node import get_app_versions
KiB=1024
@ -277,7 +278,7 @@ class _Client(node.Node, pollmixin.PollMixin):
self.nickname,
str(allmydata.__full_version__),
str(self.OLDEST_SUPPORTED_VERSION),
self.config.get_app_versions(), self._sequencer,
get_app_versions(), self._sequencer,
introducer_cache_filepath)
self.introducer_clients.append(ic)
self.introducer_furls.append(introducer['furl'])

View File

@ -161,6 +161,11 @@ def config_from_string(config_str, portnumfile, basedir):
return _Config(parser, portnumfile, basedir, '<in-memory>')
def get_app_versions():
# TODO: merge this with allmydata.get_package_versions
return dict(app_versions.versions)
def _error_about_old_config_files(basedir, generated_files):
"""
If any old configuration files are detected, raise
@ -216,10 +221,6 @@ class _Config(object):
if os.path.exists(self.config_fname):
raise
def get_app_versions(self):
# TODO: merge this with allmydata.get_package_versions
return dict(app_versions.versions)
def write_config_file(self, name, value, mode="w"):
"""
writes the given 'value' into a file called 'name' in the config