1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-13 19:18:56 +00:00

tools: drop netifaces requirement from keyctl-proxy

This commit is contained in:
Pavol Rusnak 2018-01-29 15:49:55 +01:00
parent 132660c378
commit f0152902fc
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3
import binascii
import sys
import netifaces
import Pyro4
import serpent
@ -66,12 +65,11 @@ class KeyctlProxy(object):
if __name__ == '__main__':
if len(sys.argv) > 1:
iface = sys.argv[1]
ipaddr = sys.argv[1]
else:
print('Usage: keyctl-proxy interface')
print('Usage: keyctl-proxy ipaddress')
sys.exit(1)
host = netifaces.ifaddresses(iface)[netifaces.AF_INET][0]['addr']
daemon = Pyro4.Daemon(host=host, port=PORT)
daemon = Pyro4.Daemon(host=ipaddr, port=PORT)
proxy = KeyctlProxy()
uri = daemon.register(proxy, 'keyctl')
print('keyctl-proxy running at URI: "%s"' % uri)