Update preamble_size.py for recent API changes.

pull/35/head
David Wilson 7 years ago
parent 7a50fa724e
commit 628a08e339

@ -10,15 +10,18 @@ import econtext.master
import econtext.ssh
import econtext.sudo
with econtext.master.Broker() as broker:
router = econtext.core.Router(broker)
context = econtext.master.Context(router, 0)
stream = econtext.ssh.Stream(router, 0, context.key, hostname='foo')
print 'SSH command size: %s' % (len(' '.join(stream.get_boot_command())),)
print 'Preamble size: %s (%.2fKiB)' % (
len(stream.get_preamble()),
len(stream.get_preamble()) / 1024.0,
)
broker = econtext.master.Broker()
router = econtext.core.Router(broker)
context = econtext.master.Context(router, 0)
stream = econtext.ssh.Stream(router, 0, context.key, hostname='foo')
broker.shutdown()
print 'SSH command size: %s' % (len(' '.join(stream.get_boot_command())),)
print 'Preamble size: %s (%.2fKiB)' % (
len(stream.get_preamble()),
len(stream.get_preamble()) / 1024.0,
)
for mod in (
econtext.master,

Loading…
Cancel
Save