Skip to content

EOSDevice.close() does not release the SSH session opened for file copy #423

Description

@jvanderaa

Environment

  • Python version: 3.11
  • pyntc version: 3.2.3a1

Expected Behavior

EOSDevice.close() releases the Netmiko SSH session that EOSDevice.open() creates.

Observed Behavior

EOSDevice.close() is a no-op (pass).

EOSDevice is a hybrid driver — show and config go over eAPI, but the file-transfer paths go over SSH. file_copy, check_file_exists, get_remote_checksum and remote_file_copy each call open(), which builds a real Netmiko session (native_ssh). Nothing ever disconnects it, so a caller holding many device objects accumulates one open socket per device.

eAPI itself is stateless HTTP and needs no teardown, so the no-op was reasonable before file copy was added over SSH. The leak is only that SSH session.

Steps to Reproduce

  1. device = EOSDevice(host, user, password)
  2. device.file_copy("EOS-4.28.5M.swi")open() creates the SSH session
  3. device.close() — returns without disconnecting; the socket stays open

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions