def get_field_from_args_or_session(config, args, field_name):
    """
    We try to get field_name from diffent sources:
    The order of priorioty is following:
   read_default_contract_address - command line argument (--<field_name>)
    - current session configuration (default_<filed_name>)
    """
    rez = getattr(args, field_name, None)
    if rez is not None:
        return rez
    rez = config.get_session_field('default_%s' % field_name,
        exception_if_not_found=False)
    if rez:
        return rez
    raise Exception(
        'Fail to get default_%s from config, should specify %s via --%s parameter'
         % (field_name, field_name, field_name.replace('_', '-')))
