def diff_config(ctx, second_host, mode):
    """ Config comparison between two devices.

    @param ctx: The click context paramter, for receiving the object dictionary
              | being manipulated by other previous functions. Needed by any
              | function with the @click.pass_context decorator.
    @type ctx: click.Context
    @param second_host: The IP/hostname of the second device to pull from
    @type second_host: str
    @param mode: The mode in which we are retrieving the config ('set' or
               | 'stanza')
    @type mode: str

    @returns: None. Functions part of click relating to the command group
            | 'main' do not return anything. Click handles passing context
            | between the functions and maintaing command order and chaining.
    """
    mp_pool = multiprocessing.Pool(multiprocessing.cpu_count() * 2)
    for ip in ctx.obj['hosts']:
        mp_pool.apply_async(wrap.open_connection, args=(ip,
                            ctx.obj['conn']['username'],
                            ctx.obj['conn']['password'],
                            wrap.diff_config, [second_host, mode],
                            ctx.obj['out'],
                            ctx.obj['conn']['connect_timeout'],
                            ctx.obj['conn']['session_timeout'],
                            ctx.obj['conn']['port']), callback=write_out)
    mp_pool.close()
    mp_pool.join()
def diff_config ( ctx , second_host , mode ) : mp_pool = multiprocessing . Pool ( multiprocessing . cpu_count ( ) * 2 ) for ip in ctx . obj [ 'hosts' ] : mp_pool . apply_async ( wrap . open_connection , args = ( ip , ctx . obj [ 'conn' ] [ 'username' ] , ctx . obj [ 'conn' ] [ 'password' ] , wrap . diff_config , [ second_host , mode ] , ctx . obj [ 'out' ] , ctx . obj [ 'conn' ] [ 'connect_timeout' ] , ctx . obj [ 'conn' ] [ 'session_timeout' ] , ctx . obj [ 'conn' ] [ 'port' ] ) , callback = write_out ) mp_pool . close ( ) mp_pool . join ( )
Config comparison between two devices.

    @param ctx: The click context paramter, for receiving the object dictionary
              | being manipulated by other previous functions. Needed by any
              | function with the @click.pass_context decorator.
    @type ctx: click.Context
    @param second_host: The IP/hostname of the second device to pull from
    @type second_host: str
    @param mode: The mode in which we are retrieving the config ('set' or
               | 'stanza')
    @type mode: str

    @returns: None. Functions part of click relating to the command group
            | 'main' do not return anything. Click handles passing context
            | between the functions and maintaing command order and chaining.