Project

General

Profile

Revision 4cfb3923

ID4cfb39238b72fbc60684e792841ec331df8f0226
Parent a2a8785b
Child 6ffbc4e6

Added by Travis Rhoden over 8 years ago

[RM-12699] Use hosts.get() in mon_create_initial()

That way we can pass callbacks

Fixes: #12699

Signed-off-by: Travis Rhoden <>
Reported-by: Bill Lubanovic <>

View differences:

ceph_deploy/mon.py
12 12
from ceph_deploy.new import new_mon_keyring
13 13
from ceph_deploy import hosts
14 14
from ceph_deploy.misc import mon_hosts
15
from ceph_deploy.connection import get_connection
16 15
from ceph_deploy import gatherkeys
17 16

  
18 17

  
......
416 415
        sleeps = [20, 20, 15, 10, 10, 5]
417 416
        tries = 5
418 417
        rlogger = logging.getLogger(host)
419
        rconn = get_connection(
418
        distro = hosts.get(
420 419
            host,
421 420
            username=args.username,
422
            logger=rlogger,
423 421
            callbacks=[packages.ceph_is_installed]
424 422
        )
425 423

  
426 424
        while tries:
427
            status = mon_status_check(rconn, rlogger, host, args)
425
            status = mon_status_check(distro.conn, rlogger, host, args)
428 426
            has_reached_quorum = status.get('state', '') in ['peon', 'leader']
429 427
            if not has_reached_quorum:
430 428
                LOG.warning('%s monitor is not yet in quorum, tries left: %s' % (mon_name, tries))
......
436 434
                mon_in_quorum.add(host)
437 435
                LOG.info('%s monitor has reached quorum!', mon_name)
438 436
                break
439
        rconn.exit()
437
        distro.conn.exit()
440 438

  
441 439
    if mon_in_quorum == mon_members:
442 440
        LOG.info('all initial monitors are running and have formed quorum')

Also available in: Unified diff