|
|
@ -49,6 +49,7 @@ class Peer(object): |
|
|
|
a dictionary of features, and a record of the source.''' |
|
|
|
assert isinstance(host, str) |
|
|
|
assert isinstance(features, dict) |
|
|
|
assert host in features.get('hosts', {}) |
|
|
|
self.host = host |
|
|
|
self.features = features.copy() |
|
|
|
# Canonicalize / clean-up |
|
|
@ -105,7 +106,11 @@ class Peer(object): |
|
|
|
|
|
|
|
def update_features(self, features): |
|
|
|
'''Update features in-place.''' |
|
|
|
try: |
|
|
|
tmp = Peer(self.host, features) |
|
|
|
except Exception: |
|
|
|
pass |
|
|
|
else: |
|
|
|
self.features = tmp.features |
|
|
|
for feature in self.FEATURES: |
|
|
|
setattr(self, feature, getattr(tmp, feature)) |
|
|
|