From: Sage Weil Date: Fri, 5 Apr 2013 22:37:25 +0000 (-0700) Subject: remove 'discover HOST' X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4f4a669a49574790e4137d5158e84f70789946d;p=ceph-deploy.git remove 'discover HOST' It is identical to 'config pull HOST' Signed-off-by: Sage Weil --- diff --git a/README.rst b/README.rst index 04db350..a17808a 100644 --- a/README.rst +++ b/README.rst @@ -51,7 +51,7 @@ You can use ceph-deploy to provision nodes for an existing cluster. To grab a copy of the cluster configuration file (normally ``ceph.conf``):: - ceph-deploy discover HOST + ceph-deploy config pull HOST You will usually also want to gather the encryption keys used for that cluster: diff --git a/ceph_deploy/discover.py b/ceph_deploy/discover.py deleted file mode 100644 index 5b35ead..0000000 --- a/ceph_deploy/discover.py +++ /dev/null @@ -1,59 +0,0 @@ -import logging -import os.path - -from . import misc -from .cliutil import priority - - -LOG = logging.getLogger(__name__) - - -def fetch_file(args, frompath, topath, hosts): - # mon. - if os.path.exists(topath): - LOG.debug('Have %s', topath) - return True - else: - for hostname in hosts: - LOG.debug('Checking %s for %s', hostname, frompath) - sudo = args.pushy('ssh+sudo:{hostname}'.format(hostname=hostname)) - get_file_r = sudo.compile(misc.get_file) - key = get_file_r(path=frompath.format(hostname=hostname)) - if key is not None: - LOG.debug('Got %s from %s, writing locally', topath, hostname) - if not args.dry_run: - with file(topath, 'w') as f: - f.write(key) - return True - LOG.warning('Unable to find %s on %s', frompath, hosts) - return False - -def discover(args): - ret = 0 - - # ceph.conf - r = fetch_file( - args=args, - frompath='/etc/ceph/{cluster}.conf'.format(cluster=args.cluster), - topath='{cluster}.conf'.format(cluster=args.cluster), - hosts=args.host, - ) - if not r: - ret = 1 - - return ret - -@priority(10) -def make(parser): - """ - Gather cluster configuration from another host to CLUSTER.conf. - """ - parser.add_argument( - 'host', - metavar='HOST', - nargs='*', - help='host to pull cluster information from', - ) - parser.set_defaults( - func=discover, - ) diff --git a/setup.py b/setup.py index 153a763..19168f5 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,6 @@ setup( 'ceph_deploy.cli': [ 'new = ceph_deploy.new:make', - 'discover = ceph_deploy.discover:make', 'install = ceph_deploy.install:make', 'uninstall = ceph_deploy.install:make_uninstall', 'purge = ceph_deploy.install:make_purge',