#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import argparse
import logging
import hephaestus
from pkg_resources import resource_filename
from logging import config as log_config
from hephaestus.signal_handlers import signal_handler

try:
    import configparser
except ImportError:
    from backports import configparser

os.environ['PYTHONUNBUFFERED'] = '1'
# startupLogger.info('Setting up sys.path')
# PACKAGE_PARENT = '..'
# SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
# PATH_APPEND = os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT)) + '/'
# startupLogger.info("Adding to sys.path '%s'" % PATH_APPEND)
# sys.path.append(PATH_APPEND)

parser = argparse.ArgumentParser(description="Queue Consumer", prog=hephaestus.__title__)

parser.add_argument('--version', action='version', version='%(prog)s v' + hephaestus.__version__)
parser.add_argument('-l', '--log-level',
                    dest="log_level",
                    action='store',
                    default='INFO',
                    help='Log Level to operate the program in')
parser.add_argument('-c', '--config',
                    dest="config",
                    action='store',
                    default='',
                    help='Absolute path to configuration file')
parser.add_argument('-k', '--aws-key',
                    dest="aws_key",
                    action='store',
                    help='AWS Key')
parser.add_argument('-s', '--aws-secret',
                    dest="aws_secret",
                    action='store',
                    help='AWS Secret')
parser.add_argument('-r', '--aws-region',
                    dest="aws_region",
                    action='store',
                    help='AWS Region')
parser.add_argument('-q', '--sqs-queue-name',
                    dest="queue_name",
                    action='store',
                    help='SQS Queue Name')
parser.add_argument('-v', '--visibility-timeout',
                    dest="visibility_timeout",
                    action='store',
                    help='SQS Visibility Timeout')
parser.add_argument('-m', '--max-number-of-messages',
                    dest="max_number_of_messages",
                    action='store',
                    help='Max Number of Mesages to get per request to SQS')
parser.add_argument('-t', '--wait-time-seconds',
                    dest="wait_time_seconds",
                    action='store',
                    help='Enables long polling to SQS. Value specifies how long to wait for new messages')
parser.add_argument('-wb', '--wait-between-requests',
                    dest="wait_between_requests",
                    action='store',
                    help='Wait n seconds after connection to SQS returns, before initiating a new connection')
parser.add_argument('-w', '--queue-workers',
                    dest="queue_workers",
                    action='store',
                    help='Number of SQS message fetching threads to spawn')
parser.add_argument('-mw', '--message-processor-workers',
                    dest="message_processor_workers",
                    action='store',
                    help='Number of message processor threads to spawn')
parser.add_argument('-qs', '--message-queue-max-size',
                    dest="message_queue_max_size",
                    action='store',
                    help='Max size of message queue from which message processor threads pick up messages')
parser.add_argument('-mtc', '--message-transport-conf',
                    dest="message_transport_conf",
                    action='store',
                    help='The transport configuration file location')
parser.add_argument('-rwt', '--reconnect-wait-time',
                    dest="reconnect_wait_time",
                    action='store',
                    help='Integer specifying how long to wait when queue connection fails before retrying')


args = parser.parse_args()

from hephaestus.conf import set_transports, set_config, get_log_config, verify_settings

log_config.dictConfig(get_log_config(args.log_level))
startupLogger = logging.getLogger('hephaestus.startup')
startupLogger.info('Starting up Hephaestus:%s' % hephaestus.__version__)

from hephaestus import worker


if __name__ == '__main__':
    config = configparser.ConfigParser()
    startupLogger.info("Reading configuration file")
    files_to_read_for_config = [
        resource_filename("hephaestus", "hephaestus.conf"),
        os.path.join("/etc/hephaestus", "hephaestus.conf"),
        os.path.join(os.path.expanduser('~'), "hephaestus.conf"),
        os.path.join(os.curdir, "hephaestus.conf"),
        args.config
    ]
    files_read = config.read(files_to_read_for_config)
    startupLogger.info('Config file read from - %s' % ", ".join(files_to_read_for_config))
    startupLogger.debug('Config file sections found %d. Sections - %s' % (len(config.sections()), config.sections()))
    startupLogger.info('Setting config')
    set_config(config, args)
    startupLogger.info('Setting transports')
    transport = set_transports()
    log_config.dictConfig(get_log_config(args.log_level))
    startupLogger.info('verifying settings')
    verify_settings()
    startupLogger.info('Starting workers')
    worker.start_workers(transport=transport)

13ac26333d2c58a530325aea2db237c3cf02565e
<mask token>

<mask token>
try:
    import configparser
except ImportError:
    from backports import configparser
<mask token>
parser.add_argument('--version', action='version', version='%(prog)s v' +
    hephaestus.__version__)
parser.add_argument('-l', '--log-level', dest='log_level', action='store',
    default='INFO', help='Log Level to operate the program in')
parser.add_argument('-c', '--config', dest='config', action='store',
    default='', help='Absolute path to configuration file')
parser.add_argument('-k', '--aws-key', dest='aws_key', action='store', help
    ='AWS Key')
parser.add_argument('-s', '--aws-secret', dest='aws_secret', action='store',
    help='AWS Secret')
parser.add_argument('-r', '--aws-region', dest='aws_region', action='store',
    help='AWS Region')
parser.add_argument('-q', '--sqs-queue-name', dest='queue_name', action=
    'store', help='SQS Queue Name')
parser.add_argument('-v', '--visibility-timeout', dest='visibility_timeout',
    action='store', help='SQS Visibility Timeout')
parser.add_argument('-m', '--max-number-of-messages', dest=
    'max_number_of_messages', action='store', help=
    'Max Number of Mesages to get per request to SQS')
parser.add_argument('-t', '--wait-time-seconds', dest='wait_time_seconds',
    action='store', help=
    'Enables long polling to SQS. Value specifies how long to wait for new messages'
    )
parser.add_argument('-wb', '--wait-between-requests', dest=
    'wait_between_requests', action='store', help=
    'Wait n seconds after connection to SQS returns, before initiating a new connection'
    )
parser.add_argument('-w', '--queue-workers', dest='queue_workers', action=
    'store', help='Number of SQS message fetching threads to spawn')
parser.add_argument('-mw', '--message-processor-workers', dest=
    'message_processor_workers', action='store', help=
    'Number of message processor threads to spawn')
parser.add_argument('-qs', '--message-queue-max-size', dest=
    'message_queue_max_size', action='store', help=
    'Max size of message queue from which message processor threads pick up messages'
    )
parser.add_argument('-mtc', '--message-transport-conf', dest=
    'message_transport_conf', action='store', help=
    'The transport configuration file location')
parser.add_argument('-rwt', '--reconnect-wait-time', dest=
    'reconnect_wait_time', action='store', help=
    'Integer specifying how long to wait when queue connection fails before retrying'
    )
<mask token>
log_config.dictConfig(get_log_config(args.log_level))
<mask token>
startupLogger.info('Starting up Hephaestus:%s' % hephaestus.__version__)
<mask token>
if __name__ == '__main__':
    config = configparser.ConfigParser()
    startupLogger.info('Reading configuration file')
    files_to_read_for_config = [resource_filename('hephaestus',
        'hephaestus.conf'), os.path.join('/etc/hephaestus',
        'hephaestus.conf'), os.path.join(os.path.expanduser('~'),
        'hephaestus.conf'), os.path.join(os.curdir, 'hephaestus.conf'),
        args.config]
    files_read = config.read(files_to_read_for_config)
    startupLogger.info('Config file read from - %s' % ', '.join(
        files_to_read_for_config))
    startupLogger.debug('Config file sections found %d. Sections - %s' % (
        len(config.sections()), config.sections()))
    startupLogger.info('Setting config')
    set_config(config, args)
    startupLogger.info('Setting transports')
    transport = set_transports()
    log_config.dictConfig(get_log_config(args.log_level))
    startupLogger.info('verifying settings')
    verify_settings()
    startupLogger.info('Starting workers')
    worker.start_workers(transport=transport)

<mask token>
try:
    import configparser
except ImportError:
    from backports import configparser
os.environ['PYTHONUNBUFFERED'] = '1'
parser = argparse.ArgumentParser(description='Queue Consumer', prog=
    hephaestus.__title__)
parser.add_argument('--version', action='version', version='%(prog)s v' +
    hephaestus.__version__)
parser.add_argument('-l', '--log-level', dest='log_level', action='store',
    default='INFO', help='Log Level to operate the program in')
parser.add_argument('-c', '--config', dest='config', action='store',
    default='', help='Absolute path to configuration file')
parser.add_argument('-k', '--aws-key', dest='aws_key', action='store', help
    ='AWS Key')
parser.add_argument('-s', '--aws-secret', dest='aws_secret', action='store',
    help='AWS Secret')
parser.add_argument('-r', '--aws-region', dest='aws_region', action='store',
    help='AWS Region')
parser.add_argument('-q', '--sqs-queue-name', dest='queue_name', action=
    'store', help='SQS Queue Name')
parser.add_argument('-v', '--visibility-timeout', dest='visibility_timeout',
    action='store', help='SQS Visibility Timeout')
parser.add_argument('-m', '--max-number-of-messages', dest=
    'max_number_of_messages', action='store', help=
    'Max Number of Mesages to get per request to SQS')
parser.add_argument('-t', '--wait-time-seconds', dest='wait_time_seconds',
    action='store', help=
    'Enables long polling to SQS. Value specifies how long to wait for new messages'
    )
parser.add_argument('-wb', '--wait-between-requests', dest=
    'wait_between_requests', action='store', help=
    'Wait n seconds after connection to SQS returns, before initiating a new connection'
    )
parser.add_argument('-w', '--queue-workers', dest='queue_workers', action=
    'store', help='Number of SQS message fetching threads to spawn')
parser.add_argument('-mw', '--message-processor-workers', dest=
    'message_processor_workers', action='store', help=
    'Number of message processor threads to spawn')
parser.add_argument('-qs', '--message-queue-max-size', dest=
    'message_queue_max_size', action='store', help=
    'Max size of message queue from which message processor threads pick up messages'
    )
parser.add_argument('-mtc', '--message-transport-conf', dest=
    'message_transport_conf', action='store', help=
    'The transport configuration file location')
parser.add_argument('-rwt', '--reconnect-wait-time', dest=
    'reconnect_wait_time', action='store', help=
    'Integer specifying how long to wait when queue connection fails before retrying'
    )
args = parser.parse_args()
<mask token>
log_config.dictConfig(get_log_config(args.log_level))
startupLogger = logging.getLogger('hephaestus.startup')
startupLogger.info('Starting up Hephaestus:%s' % hephaestus.__version__)
<mask token>
if __name__ == '__main__':
    config = configparser.ConfigParser()
    startupLogger.info('Reading configuration file')
    files_to_read_for_config = [resource_filename('hephaestus',
        'hephaestus.conf'), os.path.join('/etc/hephaestus',
        'hephaestus.conf'), os.path.join(os.path.expanduser('~'),
        'hephaestus.conf'), os.path.join(os.curdir, 'hephaestus.conf'),
        args.config]
    files_read = config.read(files_to_read_for_config)
    startupLogger.info('Config file read from - %s' % ', '.join(
        files_to_read_for_config))
    startupLogger.debug('Config file sections found %d. Sections - %s' % (
        len(config.sections()), config.sections()))
    startupLogger.info('Setting config')
    set_config(config, args)
    startupLogger.info('Setting transports')
    transport = set_transports()
    log_config.dictConfig(get_log_config(args.log_level))
    startupLogger.info('verifying settings')
    verify_settings()
    startupLogger.info('Starting workers')
    worker.start_workers(transport=transport)

from __future__ import absolute_import, division, print_function, unicode_literals
import os
import argparse
import logging
import hephaestus
from pkg_resources import resource_filename
from logging import config as log_config
from hephaestus.signal_handlers import signal_handler
try:
    import configparser
except ImportError:
    from backports import configparser
os.environ['PYTHONUNBUFFERED'] = '1'
parser = argparse.ArgumentParser(description='Queue Consumer', prog=
    hephaestus.__title__)
parser.add_argument('--version', action='version', version='%(prog)s v' +
    hephaestus.__version__)
parser.add_argument('-l', '--log-level', dest='log_level', action='store',
    default='INFO', help='Log Level to operate the program in')
parser.add_argument('-c', '--config', dest='config', action='store',
    default='', help='Absolute path to configuration file')
parser.add_argument('-k', '--aws-key', dest='aws_key', action='store', help
    ='AWS Key')
parser.add_argument('-s', '--aws-secret', dest='aws_secret', action='store',
    help='AWS Secret')
parser.add_argument('-r', '--aws-region', dest='aws_region', action='store',
    help='AWS Region')
parser.add_argument('-q', '--sqs-queue-name', dest='queue_name', action=
    'store', help='SQS Queue Name')
parser.add_argument('-v', '--visibility-timeout', dest='visibility_timeout',
    action='store', help='SQS Visibility Timeout')
parser.add_argument('-m', '--max-number-of-messages', dest=
    'max_number_of_messages', action='store', help=
    'Max Number of Mesages to get per request to SQS')
parser.add_argument('-t', '--wait-time-seconds', dest='wait_time_seconds',
    action='store', help=
    'Enables long polling to SQS. Value specifies how long to wait for new messages'
    )
parser.add_argument('-wb', '--wait-between-requests', dest=
    'wait_between_requests', action='store', help=
    'Wait n seconds after connection to SQS returns, before initiating a new connection'
    )
parser.add_argument('-w', '--queue-workers', dest='queue_workers', action=
    'store', help='Number of SQS message fetching threads to spawn')
parser.add_argument('-mw', '--message-processor-workers', dest=
    'message_processor_workers', action='store', help=
    'Number of message processor threads to spawn')
parser.add_argument('-qs', '--message-queue-max-size', dest=
    'message_queue_max_size', action='store', help=
    'Max size of message queue from which message processor threads pick up messages'
    )
parser.add_argument('-mtc', '--message-transport-conf', dest=
    'message_transport_conf', action='store', help=
    'The transport configuration file location')
parser.add_argument('-rwt', '--reconnect-wait-time', dest=
    'reconnect_wait_time', action='store', help=
    'Integer specifying how long to wait when queue connection fails before retrying'
    )
args = parser.parse_args()
from hephaestus.conf import set_transports, set_config, get_log_config, verify_settings
log_config.dictConfig(get_log_config(args.log_level))
startupLogger = logging.getLogger('hephaestus.startup')
startupLogger.info('Starting up Hephaestus:%s' % hephaestus.__version__)
from hephaestus import worker
if __name__ == '__main__':
    config = configparser.ConfigParser()
    startupLogger.info('Reading configuration file')
    files_to_read_for_config = [resource_filename('hephaestus',
        'hephaestus.conf'), os.path.join('/etc/hephaestus',
        'hephaestus.conf'), os.path.join(os.path.expanduser('~'),
        'hephaestus.conf'), os.path.join(os.curdir, 'hephaestus.conf'),
        args.config]
    files_read = config.read(files_to_read_for_config)
    startupLogger.info('Config file read from - %s' % ', '.join(
        files_to_read_for_config))
    startupLogger.debug('Config file sections found %d. Sections - %s' % (
        len(config.sections()), config.sections()))
    startupLogger.info('Setting config')
    set_config(config, args)
    startupLogger.info('Setting transports')
    transport = set_transports()
    log_config.dictConfig(get_log_config(args.log_level))
    startupLogger.info('verifying settings')
    verify_settings()
    startupLogger.info('Starting workers')
    worker.start_workers(transport=transport)

#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import argparse
import logging
import hephaestus
from pkg_resources import resource_filename
from logging import config as log_config
from hephaestus.signal_handlers import signal_handler

try:
    import configparser
except ImportError:
    from backports import configparser

os.environ['PYTHONUNBUFFERED'] = '1'
# startupLogger.info('Setting up sys.path')
# PACKAGE_PARENT = '..'
# SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
# PATH_APPEND = os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT)) + '/'
# startupLogger.info("Adding to sys.path '%s'" % PATH_APPEND)
# sys.path.append(PATH_APPEND)

parser = argparse.ArgumentParser(description="Queue Consumer", prog=hephaestus.__title__)

parser.add_argument('--version', action='version', version='%(prog)s v' + hephaestus.__version__)
parser.add_argument('-l', '--log-level',
                    dest="log_level",
                    action='store',
                    default='INFO',
                    help='Log Level to operate the program in')
parser.add_argument('-c', '--config',
                    dest="config",
                    action='store',
                    default='',
                    help='Absolute path to configuration file')
parser.add_argument('-k', '--aws-key',
                    dest="aws_key",
                    action='store',
                    help='AWS Key')
parser.add_argument('-s', '--aws-secret',
                    dest="aws_secret",
                    action='store',
                    help='AWS Secret')
parser.add_argument('-r', '--aws-region',
                    dest="aws_region",
                    action='store',
                    help='AWS Region')
parser.add_argument('-q', '--sqs-queue-name',
                    dest="queue_name",
                    action='store',
                    help='SQS Queue Name')
parser.add_argument('-v', '--visibility-timeout',
                    dest="visibility_timeout",
                    action='store',
                    help='SQS Visibility Timeout')
parser.add_argument('-m', '--max-number-of-messages',
                    dest="max_number_of_messages",
                    action='store',
                    help='Max Number of Mesages to get per request to SQS')
parser.add_argument('-t', '--wait-time-seconds',
                    dest="wait_time_seconds",
                    action='store',
                    help='Enables long polling to SQS. Value specifies how long to wait for new messages')
parser.add_argument('-wb', '--wait-between-requests',
                    dest="wait_between_requests",
                    action='store',
                    help='Wait n seconds after connection to SQS returns, before initiating a new connection')
parser.add_argument('-w', '--queue-workers',
                    dest="queue_workers",
                    action='store',
                    help='Number of SQS message fetching threads to spawn')
parser.add_argument('-mw', '--message-processor-workers',
                    dest="message_processor_workers",
                    action='store',
                    help='Number of message processor threads to spawn')
parser.add_argument('-qs', '--message-queue-max-size',
                    dest="message_queue_max_size",
                    action='store',
                    help='Max size of message queue from which message processor threads pick up messages')
parser.add_argument('-mtc', '--message-transport-conf',
                    dest="message_transport_conf",
                    action='store',
                    help='The transport configuration file location')
parser.add_argument('-rwt', '--reconnect-wait-time',
                    dest="reconnect_wait_time",
                    action='store',
                    help='Integer specifying how long to wait when queue connection fails before retrying')


args = parser.parse_args()

from hephaestus.conf import set_transports, set_config, get_log_config, verify_settings

log_config.dictConfig(get_log_config(args.log_level))
startupLogger = logging.getLogger('hephaestus.startup')
startupLogger.info('Starting up Hephaestus:%s' % hephaestus.__version__)

from hephaestus import worker


if __name__ == '__main__':
    config = configparser.ConfigParser()
    startupLogger.info("Reading configuration file")
    files_to_read_for_config = [
        resource_filename("hephaestus", "hephaestus.conf"),
        os.path.join("/etc/hephaestus", "hephaestus.conf"),
        os.path.join(os.path.expanduser('~'), "hephaestus.conf"),
        os.path.join(os.curdir, "hephaestus.conf"),
        args.config
    ]
    files_read = config.read(files_to_read_for_config)
    startupLogger.info('Config file read from - %s' % ", ".join(files_to_read_for_config))
    startupLogger.debug('Config file sections found %d. Sections - %s' % (len(config.sections()), config.sections()))
    startupLogger.info('Setting config')
    set_config(config, args)
    startupLogger.info('Setting transports')
    transport = set_transports()
    log_config.dictConfig(get_log_config(args.log_level))
    startupLogger.info('verifying settings')
    verify_settings()
    startupLogger.info('Starting workers')
    worker.start_workers(transport=transport)
