From: Alfredo Deza Date: Tue, 24 Jun 2014 19:37:39 +0000 (-0400) Subject: fix imports on top level modules X-Git-Tag: v1.5.6~6^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8bf9159d8ae7564cd7a2344eb101e377d1e15b80;p=ceph-deploy.git fix imports on top level modules Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/calamari.py b/ceph_deploy/calamari.py index a7e0617..0c835ba 100644 --- a/ceph_deploy/calamari.py +++ b/ceph_deploy/calamari.py @@ -2,7 +2,7 @@ import errno import logging import os from ceph_deploy import hosts, exc -from ceph_deploy.lib.remoto import process +from ceph_deploy.lib import remoto LOG = logging.getLogger(__name__) @@ -96,12 +96,12 @@ def connect(args): # redhat/centos need to get the service started if distro.normalized_name in ['redhat', 'centos']: - process.run( + remoto.process.run( distro.conn, ['chkconfig', 'salt-minion', 'on'] ) - process.run( + remoto.process.run( distro.conn, ['service', 'salt-minion', 'start'] ) diff --git a/ceph_deploy/connection.py b/ceph_deploy/connection.py index b88c1ac..b06b9e3 100644 --- a/ceph_deploy/connection.py +++ b/ceph_deploy/connection.py @@ -1,6 +1,6 @@ import getpass import socket -from ceph_deploy.lib.remoto import Connection +from ceph_deploy.lib import remoto def get_connection(hostname, username, logger, threads=5, use_sudo=None): @@ -13,7 +13,7 @@ def get_connection(hostname, username, logger, threads=5, use_sudo=None): if username: hostname = "%s@%s" % (username, hostname) try: - conn = Connection( + conn = remoto.Connection( hostname, logger=logger, sudo=use_sudo, diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py index 2605568..05a5e3a 100644 --- a/ceph_deploy/install.py +++ b/ceph_deploy/install.py @@ -4,7 +4,7 @@ import os from ceph_deploy import hosts from ceph_deploy.cliutil import priority -from ceph_deploy.lib.remoto import process, rsync +from ceph_deploy.lib import remoto LOG = logging.getLogger(__name__) @@ -67,7 +67,7 @@ def install(args): gpg_url = gpg_fallback if args.local_mirror: - rsync(hostname, args.local_mirror, '/opt/ceph-deploy/repo', distro.conn.logger, sudo=True) + remoto.rsync(hostname, args.local_mirror, '/opt/ceph-deploy/repo', distro.conn.logger, sudo=True) repo_url = 'file:///opt/ceph-deploy/repo' gpg_url = 'file:///opt/ceph-deploy/repo/release.asc' @@ -251,7 +251,7 @@ def purgedata(args): # Try to remove the contents of /var/lib/ceph first, don't worry # about errors here, we deal with them later on - process.check( + remoto.process.check( distro.conn, [ 'rm', '-rf', '--one-file-system', '--', '/var/lib/ceph', @@ -264,7 +264,7 @@ def purgedata(args): rlogger.warning( 'OSDs may still be mounted, trying to unmount them' ) - process.run( + remoto.process.run( distro.conn, [ 'find', '/var/lib/ceph', @@ -277,14 +277,14 @@ def purgedata(args): # And now we try again to remove the contents, since OSDs should be # unmounted, but this time we do check for errors - process.run( + remoto.process.run( distro.conn, [ 'rm', '-rf', '--one-file-system', '--', '/var/lib/ceph', ] ) - process.run( + remoto.process.run( distro.conn, [ 'rm', '-rf', '--one-file-system', '--', '/etc/ceph/', diff --git a/ceph_deploy/mds.py b/ceph_deploy/mds.py index 3f8ba7e..49fee94 100644 --- a/ceph_deploy/mds.py +++ b/ceph_deploy/mds.py @@ -6,7 +6,7 @@ import os from ceph_deploy import conf from ceph_deploy import exc from ceph_deploy import hosts -from ceph_deploy.lib.remoto import process +from ceph_deploy.lib import remoto from ceph_deploy.cliutil import priority @@ -40,7 +40,7 @@ def create_mds(conn, name, cluster, init): keypath = os.path.join(path, 'keyring') - stdout, stderr, returncode = process.check( + stdout, stderr, returncode = remoto.process.check( conn, [ 'ceph', @@ -64,7 +64,7 @@ def create_mds(conn, name, cluster, init): conn.logger.error('exit code from command was: %s' % returncode) raise RuntimeError('could not create mds') - process.check( + remoto.process.check( conn, [ 'ceph', @@ -84,7 +84,7 @@ def create_mds(conn, name, cluster, init): conn.remote_module.touch_file(os.path.join(path, init)) if init == 'upstart': - process.run( + remoto.process.run( conn, [ 'initctl', @@ -96,7 +96,7 @@ def create_mds(conn, name, cluster, init): timeout=7 ) elif init == 'sysvinit': - process.run( + remoto.process.run( conn, [ 'service', diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py index 404b2b3..2b6c177 100644 --- a/ceph_deploy/mon.py +++ b/ceph_deploy/mon.py @@ -9,7 +9,7 @@ import time from ceph_deploy import conf, exc, admin from ceph_deploy.cliutil import priority from ceph_deploy.util import paths, net -from ceph_deploy.lib.remoto import process +from ceph_deploy.lib import remoto from ceph_deploy import hosts from ceph_deploy.misc import mon_hosts from ceph_deploy.connection import get_connection @@ -30,7 +30,7 @@ def mon_status_check(conn, logger, hostname, args): """ asok_path = paths.mon.asok(args.cluster, hostname) - out, err, code = process.check( + out, err, code = remoto.process.check( conn, [ 'ceph', @@ -246,7 +246,7 @@ def destroy_mon(conn, cluster, hostname): if conn.remote_module.path_exists(path): # remove from cluster - process.run( + remoto.process.run( conn, [ 'ceph', @@ -295,7 +295,7 @@ def destroy_mon(conn, cluster, hostname): stamp=datetime.datetime.utcnow().strftime("%Y-%m-%dZ%H:%M:%S"), ) - process.run( + remoto.process.run( conn, [ 'mkdir', @@ -479,7 +479,7 @@ def is_running(conn, args): mon.mira094: dead {"version":"0.61.5"} mon.mira094: not running {"version":"0.61.5"} """ - stdout, stderr, _ = process.check( + stdout, stderr, _ = remoto.process.check( conn, args ) diff --git a/ceph_deploy/new.py b/ceph_deploy/new.py index 8e7b3b2..3af1403 100644 --- a/ceph_deploy/new.py +++ b/ceph_deploy/new.py @@ -11,7 +11,7 @@ from ceph_deploy.cliutil import priority from ceph_deploy import conf, hosts, exc from ceph_deploy.util import arg_validators, ssh, net from ceph_deploy.misc import mon_hosts -from ceph_deploy.lib.remoto import process +from ceph_deploy.lib import remoto from ceph_deploy.connection import get_local_connection @@ -43,7 +43,7 @@ def ssh_copy_keys(hostname, username=None): if not os.path.exists(id_rsa_file): LOG.info('creating a passwordless id_rsa.pub key file') with get_local_connection(LOG) as conn: - process.run( + remoto.process.run( conn, [ 'ssh-keygen', diff --git a/ceph_deploy/osd.py b/ceph_deploy/osd.py index 7fc405d..608084d 100644 --- a/ceph_deploy/osd.py +++ b/ceph_deploy/osd.py @@ -12,7 +12,7 @@ from cStringIO import StringIO from ceph_deploy import conf, exc, hosts from ceph_deploy.util import constants from ceph_deploy.cliutil import priority -from ceph_deploy.lib.remoto import process +from ceph_deploy.lib import remoto LOG = logging.getLogger(__name__) @@ -42,7 +42,7 @@ def create_osd(conn, cluster, key): logger.warning('osd keyring does not exist yet, creating one') conn.remote_module.write_keyring(path, key) - return process.run( + return remoto.process.run( conn, [ 'udevadm', @@ -79,7 +79,7 @@ def osd_tree(conn, cluster): '--format=json', ] - out, err, code = process.check( + out, err, code = remoto.process.check( conn, command, ) @@ -125,7 +125,7 @@ def osd_status_check(conn, cluster): ] try: - out, err, code = process.check( + out, err, code = remoto.process.check( conn, command, ) @@ -224,13 +224,13 @@ def prepare_disk( if journal is not None: args.append(journal) - process.run( + remoto.process.run( conn, args ) if activate_prepared_disk: - return process.run( + return remoto.process.run( conn, [ 'udevadm', @@ -330,7 +330,7 @@ def activate(args, cfg): LOG.debug('activating host %s disk %s', hostname, disk) LOG.debug('will use init type: %s', distro.init) - process.run( + remoto.process.run( distro.conn, [ 'ceph-disk-activate', @@ -365,7 +365,7 @@ def disk_zap(args): # zero the device distro.conn.remote_module.zeroing(disk) - process.run( + remoto.process.run( distro.conn, [ 'sgdisk', @@ -390,7 +390,7 @@ def disk_list(args, cfg): ) LOG.debug('Listing disks on {hostname}...'.format(hostname=hostname)) - process.run( + remoto.process.run( distro.conn, [ 'ceph-disk', @@ -425,7 +425,7 @@ def osd_list(args, cfg): remote_module = distro.conn.remote_module osds = distro.conn.remote_module.listdir(constants.osd_path) - output, err, exit_code = process.check( + output, err, exit_code = remoto.process.check( distro.conn, [ 'ceph-disk',