From f494bfcd3d7bd0ce2f31cd6e4ad3c2d01452169b Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Wed, 1 Aug 2012 23:44:21 -0700 Subject: [PATCH] Fixes for install issues on Ubuntu 12.04 --- setup.py | 6 +++--- sshmap/__init__.py | 3 +++ sshmap/hostlists.py | 3 +++ sshmap/hostlists/.svn/entries | 31 ------------------------------- sshmap/hostlists/plugins/files.py | 13 ------------- sshmap/sshmap.py | 4 ++-- 6 files changed, 11 insertions(+), 49 deletions(-) delete mode 100644 sshmap/hostlists/.svn/entries delete mode 100755 sshmap/hostlists/plugins/files.py diff --git a/setup.py b/setup.py index 09d49d3..10b4467 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup """ - Copyright (c) 2010 Yahoo! Inc. All rights reserved. + Copyright (c) 2012 Yahoo! Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -18,13 +18,13 @@ setup( name="sshmap", - version="0.2.0", + version="0.2.10", author="Dwight Hubbard", author_email="dhubbard@yahoo-inc.com", url="http://www.yahoo.com", license="LICENSE.txt", packages=["sshmap"], - scripts=["sshmap"], + scripts=["sshmap/sshmap.py"], long_description=open('README.txt').read(), description="A SSH Multiplexer desgined to use ssh to perform map/reduce like operations", requires=['paramiko'], diff --git a/sshmap/__init__.py b/sshmap/__init__.py index 7a62477..46e6a3e 100644 --- a/sshmap/__init__.py +++ b/sshmap/__init__.py @@ -12,3 +12,6 @@ See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. """ +from sshmap import * + + diff --git a/sshmap/hostlists.py b/sshmap/hostlists.py index 47c232f..9cb7b72 100755 --- a/sshmap/hostlists.py +++ b/sshmap/hostlists.py @@ -47,6 +47,9 @@ def _get_plugins(): def expand(range_list): """ Expand a list of plugin:parameters into a list of hosts """ + if type(range_list) is str: + range_list=[range_list] + # Find all the host list plugins plugins=_get_plugins() diff --git a/sshmap/hostlists/.svn/entries b/sshmap/hostlists/.svn/entries deleted file mode 100644 index 65a4e3b..0000000 --- a/sshmap/hostlists/.svn/entries +++ /dev/null @@ -1,31 +0,0 @@ -10 - -dir -56295 -svn+ssh://svn.corp.yahoo.com/yahoo/users/dhubbard/sshmap_opensource/sshmap/hostlists -svn+ssh://svn.corp.yahoo.com/yahoo/users - - - -2012-07-07T01:22:15.469459Z -56182 -dhubbard - - - - - - - - - - - - - - -9c6bb43a-1051-0410-9f52-8985cf0311e8 - -plugins -dir - diff --git a/sshmap/hostlists/plugins/files.py b/sshmap/hostlists/plugins/files.py deleted file mode 100755 index ae6b5a4..0000000 --- a/sshmap/hostlists/plugins/files.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python -""" hostlists plugin to get hosts from a file """ - -def name(): - return 'file' - -def expand(value): - tmplist=[] - for host in [i.strip() for i in open(value,'r').readlines()]: - if not host.startswith('#'): - tmplist.append(host) - return tmplist - \ No newline at end of file diff --git a/sshmap/sshmap.py b/sshmap/sshmap.py index 201eee8..a6eb0ed 100755 --- a/sshmap/sshmap.py +++ b/sshmap/sshmap.py @@ -2,7 +2,7 @@ """ Python based ssh multiplexer optimized for map operations """ """ - Copyright (c) 2010 Yahoo! Inc. All rights reserved. + Copyright (c) 2012 Yahoo! Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -417,7 +417,7 @@ def run(range,command,username=None,password=None,sudo=False,script=None,timeout None """ status_info(output_callback,' \bLooking up hosts') - hosts=hostlists.expandrange(range,compress=False).split(',') + hosts=hostlists.expand(range) if shuffle: random.shuffle(hosts) status_clear()