From: Brian Warner Date: Sat, 20 Sep 2008 18:38:53 +0000 (-0700) Subject: use foolscap's new app_versions API, require foolscap-0.3.1 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/flags/something?a=commitdiff_plain;h=c6999d219e33563f2a360b1cea3b5afe80a12e98;p=tahoe-lafs%2Ftahoe-lafs.git use foolscap's new app_versions API, require foolscap-0.3.1 --- diff --git a/_auto_deps.py b/_auto_deps.py index 0712ec02..46d455ca 100644 --- a/_auto_deps.py +++ b/_auto_deps.py @@ -1,5 +1,5 @@ install_requires=["zfec >= 1.1.0", - "foolscap[secure_connections] >= 0.3.0", + "foolscap[secure_connections] >= 0.3.1", "simplejson >= 1.4", # pycryptopp < 0.5 had a bug which, using a Microsoft diff --git a/src/allmydata/node.py b/src/allmydata/node.py index 8ad62706..f7c74872 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -15,13 +15,13 @@ from allmydata.util.assertutil import precondition # Just to get their versions: import allmydata, pycryptopp, zfec -from foolscap.logging.publish import LogPublisher +from foolscap.logging import app_versions # Add our application versions to the data that Foolscap's LogPublisher # reports. Our __version__ attributes are actually instances of a "Version" # class, so convert them into strings first. -LogPublisher.versions['allmydata'] = str(allmydata.__version__) -LogPublisher.versions['zfec'] = str(zfec.__version__) -LogPublisher.versions['pycryptopp'] = str(pycryptopp.__version__) +app_versions.add_version('allmydata', str(allmydata.__version__)) +app_versions.add_version('zfec', str(zfec.__version__)) +app_versions.add_version('pycryptopp', str(pycryptopp.__version__)) # group 1 will be addr (dotted quad string), group 3 if any will be portnum (string) ADDR_RE=re.compile("^([1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*)(:([1-9][0-9]*))?$") @@ -90,6 +90,10 @@ class Node(service.MultiService): self.log("Node constructed. " + get_package_versions_string()) iputil.increase_rlimits() + def get_app_versions(self): + # TODO: merge this with allmydata.get_package_versions + return dict(app_versions.versions) + def get_config(self, name, required=False): """Get the (string) contents of a config file, or None if the file did not exist. If required=True, raise an exception rather than