diff --git a/synapse/tests/test_tools_aha.py b/synapse/tests/test_tools_aha.py index e3f670d267..b7b866a581 100644 --- a/synapse/tests/test_tools_aha.py +++ b/synapse/tests/test_tools_aha.py @@ -260,6 +260,13 @@ async def test_aha_mirror(self): self.eq(retn, 1) outp.expect(f'Service at {ahaurl} does not support the required callpeers feature.') + with mock.patch('synapse.telepath.Proxy._hasTeleFeat', + side_effect=s_exc.NoSuchMeth(name='_hasTeleFeat')): + argv = ['--url', ahaurl] + retn, outp = await self.execToolMain(s_a_mirror.main, argv) + self.eq(retn, 1) + outp.expect(f'Service at {ahaurl} does not support the required callpeers feature.') + argv = ['--url', 'tcp://newp:1234/'] retn, outp = await self.execToolMain(s_a_mirror.main, argv) self.eq(retn, 1) diff --git a/synapse/tools/aha/mirror.py b/synapse/tools/aha/mirror.py index ccf2ea1883..77f5fa3c5b 100644 --- a/synapse/tools/aha/mirror.py +++ b/synapse/tools/aha/mirror.py @@ -99,9 +99,8 @@ async def main(argv, outp=s_output.stdout): if not prox._hasTeleFeat('callpeers', vers=1): outp.printf(f'Service at {opts.url} does not support the required callpeers feature.') return 1 - except s_exc.BadVersion as e: - valu = s_version.fmtVersion(*e.get('valu')) - outp.printf(f'Proxy version {valu} is outside of the aha supported range ({reqver}).') + except s_exc.NoSuchMeth: + outp.printf(f'Service at {opts.url} does not support the required callpeers feature.') return 1 classes = prox._getClasses() if 'synapse.lib.aha.AhaApi' not in classes: