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__)
# 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']
)
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):
if username:
hostname = "%s@%s" % (username, hostname)
try:
- conn = Connection(
+ conn = remoto.Connection(
hostname,
logger=logger,
sudo=use_sudo,
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__)
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'
# 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',
rlogger.warning(
'OSDs may still be mounted, trying to unmount them'
)
- process.run(
+ remoto.process.run(
distro.conn,
[
'find', '/var/lib/ceph',
# 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/',
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
keypath = os.path.join(path, 'keyring')
- stdout, stderr, returncode = process.check(
+ stdout, stderr, returncode = remoto.process.check(
conn,
[
'ceph',
conn.logger.error('exit code from command was: %s' % returncode)
raise RuntimeError('could not create mds')
- process.check(
+ remoto.process.check(
conn,
[
'ceph',
conn.remote_module.touch_file(os.path.join(path, init))
if init == 'upstart':
- process.run(
+ remoto.process.run(
conn,
[
'initctl',
timeout=7
)
elif init == 'sysvinit':
- process.run(
+ remoto.process.run(
conn,
[
'service',
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
"""
asok_path = paths.mon.asok(args.cluster, hostname)
- out, err, code = process.check(
+ out, err, code = remoto.process.check(
conn,
[
'ceph',
if conn.remote_module.path_exists(path):
# remove from cluster
- process.run(
+ remoto.process.run(
conn,
[
'ceph',
stamp=datetime.datetime.utcnow().strftime("%Y-%m-%dZ%H:%M:%S"),
)
- process.run(
+ remoto.process.run(
conn,
[
'mkdir',
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
)
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
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',
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__)
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',
'--format=json',
]
- out, err, code = process.check(
+ out, err, code = remoto.process.check(
conn,
command,
)
]
try:
- out, err, code = process.check(
+ out, err, code = remoto.process.check(
conn,
command,
)
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',
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',
# zero the device
distro.conn.remote_module.zeroing(disk)
- process.run(
+ remoto.process.run(
distro.conn,
[
'sgdisk',
)
LOG.debug('Listing disks on {hostname}...'.format(hostname=hostname))
- process.run(
+ remoto.process.run(
distro.conn,
[
'ceph-disk',
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',