paramiko exec_command timeout

Share

I have a paramiko program which sshs to a large number of machines, and sometimes it hits a machine where Channel.exec_command() doesn’t return. I know this is a problem with the remote machine, because the same thing happens when I try to ssh to the machine from the command line. However, I don’t have any way of determining which machines are broken beforehand.

Paramiko doesn’t support a timeout for exec_command(), so I am looking for a generic way of running a function call with a timeout. I can see sample code which does this using threads, but that’s pretty ugly. I can’t use SIGALARM because I am not running on the main thread.

Can anyone think of a better way of doing this?

Share

MythNetTV release 6

Share

New things in this release:

    Better testing:

  • r114: Unit tests for video.py
  • r148: Updated unit test now that we create more tables
  • r151: Start work on syndication unit tests
  • r153: Unit test for bad syndication dates, as well as more flexibility in
    db connections needed for this unit test

  • r157: Nicer unit test failure output, and refactor GetVideoDir() into the
    utility module

  • r181: Slightly improve syndication unit tests
  • r183: Add flag parsing to unit tests, and fix some more flag name changes
    Better documentation:

  • r117: Added a man page for video.py — I’m not 100% happy with its name
    though
    Bug fixes:

  • r114: Fixed a bug where the new filename for video transcode could be the
    same as the input filename, resulting in video corruption. This was found
    with one of the new video.py unit tests

  • r116: The logic for the –prompt flag was the wrong way around. Fixed.
  • r119: Nicer download status messages
  • r121: Handle 404s in feed updates better
  • r129: Slight tweak to SVN submit script
  • r131: More accurate tracking of proxy usage (update during download,
    instead of just at the end)

  • r137: Proxy budget being exceeded doesn’t count as a failed download
    attempt

  • r143: Subscribe now renables inactive subscriptions
  • r146: Add support to decimals to utility byte printer, fix a bug in the
    check for video directories

  • r155: Have users send problems to the mailing list, instead of me
    personally

  • r161: Don’t throw exceptions for the videodir command line
  • r167, 169: Display friendly sizes in records_tool output
  • r171: Move verbose update arg into a flag
  • r173: Add “-vo null” to mplayer invocation per Ryan Lutz. This improves
    support on machines without X, and speeds up the identify operation

  • r175: Import patch from Thomas Mashos which fixes subscription removal,
    started work on syndication unit test improvements

  • r177: Fix character escaping bug in show subtitles during import
  • r179: Renamed –datadirdefault to –datadir. If set this will now change
    your data directory, regardless of if there was a previous value set.

  • r190: Recording_tool now prompts for deletes
  • r192: Improved explainvideodir output
  • r194: Don’t crash in explainvideodir if there is no video directory
  • r197: Order results by subtitle in recordings_tool output
    New features:

  • r115: Upgraded schema to version 15 to support http_proxies for
    subscriptions. Added http_proxy command line, which allows you to use HTTP
    proxies for specified URLs. Moved HTTP accesses to use the proxy code.

  • r127: Bump schema to v17, and add proxy use tracking including the
    “proxyusage” command

  • r133: Allow daily budgets for proxy usage
  • r115: Provide a user agent for HTTP requests, instead of just
    Python-urllib/1.17

  • r117: Users will now be prompted to subscribe to an announcements video
    feed. This will happen exactly once. This behavior may be disabled with
    the –nopromptforannounce command line flag.

  • r125: Add a full info dump command to video.py’s command line interface
  • r139: Bump schema to 19, and implement categories with the “category”
    command

  • r141: Implement recording group support, and clarify category support
  • r151: Implement a helper (recordings_tool) for handling the MythTV
    recordings table, this is useful for testing.

  • r159: Add videodir and explainvideodir debugging commands, and update man
    page

  • r163: Add title list feature to recordings_tool
  • r165: Include recording count in title list
  • r185: Add the resetattempts command
    Development changes:

  • r123: Added a submit script to automate putting the revision number into
    the ChangeLog

  • r135: Tweak to new ChangeLog auto logging formatting

Release 6 continues the tradition of better testing, improves the documentation (a little, there is more work to be done there), fixes a bunch of bugs, and implements some new features which will hopefully be useful to others. Please grab your copy here.

Share