Esempio n. 1
0
    if not options.env:
        parser.print_help()
        sys.exit()
    if not options.vpn_name:
        parser.print_help()
        sys.exit()
    if options.testmode:
        logging.info("TEST MODE ACTIVE!!!")

    settings.env = options.env.lower()

    logging.info("Connecting to appliance in %s, testmode:%s" %
                 (settings.env, options.testmode))
    connection = SolaceAPI(settings.env, testmode=options.testmode)
    queues = connection.list_queues(options.vpn_name)
    commands = generateXMLForManagingRejectMsgToSenderOnDiscard(
        vpn_name=options.vpn_name,
        queues=queues,
        reject_msg_to_sender_on_discard=options.reject_msg_to_sender_on_discard
    )

    print("The following queues will be manipulated in %s environment! " %
          settings.env)
    pprint.pprint(queues)

    s = raw_input('Do you want to continue? N/y? ')

    if s.lower() == 'y':
        for cmd in commands.commands:
            connection.rpc(str(cmd))
    if not options.vpn_name:
        parser.print_help()
        sys.exit()
    if options.testmode:
        logging.info("TEST MODE ACTIVE!!!")

    settings.env = options.env.lower()

    logging.info("Connecting to appliance in %s, testmode:%s" % (settings.env, options.testmode))
    connection = SolaceAPI(settings.env, testmode=options.testmode)

    print("Available VPNS are: %s" % connection.manage(SOLACE_VPN_PLUGIN).list_vpns(vpn_name='*'))

    if options.queue_filter:
        print("You have said that the queue mentioned is a filter, searching for queues")
        queues = connection.list_queues(options.vpn_name, queue_filter=options.queues)
    else:
        queues = options.queues.split(',')
    print("The following queues will be manipulated in %s environment! " % settings.env)
    pprint.pprint(queues)

    # validating the plan
    validate_the_plan(connection=connection, vpn_name=options.vpn_name, queues=queues)

    s = raw_input('Do you want to continue? N/y? ')

    if s.lower() == 'y':
        for queue in queues:
            x = delete_msgs_request(connection=connection, vpn_name=options.vpn_name, queue=queue)
            connection.rpc(x, primaryOnly=True)
    else:
Esempio n. 3
0
        logging.info("TEST MODE ACTIVE!!!")

    settings.env = options.env.lower()

    logging.info("Connecting to appliance in %s, testmode:%s" %
                 (settings.env, options.testmode))
    connection = SolaceAPI(settings.env, testmode=options.testmode)

    print("Available VPNS are: %s" %
          connection.manage(SOLACE_VPN_PLUGIN).list_vpns(vpn_name='*'))

    if options.queue_filter:
        print(
            "You have said that the queue mentioned is a filter, searching for queues"
        )
        queues = connection.list_queues(options.vpn_name,
                                        queue_filter=options.queues)
    else:
        queues = options.queues.split(',')
    print("The following queues will be manipulated in %s environment! " %
          settings.env)
    pprint.pprint(queues)

    # validating the plan
    validate_the_plan(connection=connection,
                      vpn_name=options.vpn_name,
                      queues=queues)

    s = raw_input('Do you want to continue? N/y? ')

    if s.lower() == 'y':
        for queue in queues:
                      default=False, help="set to enable reject-msg-to-sender-on-discard")
    (options, args) = parser.parse_args()

    if not options.env:
        parser.print_help()
        sys.exit()
    if not options.vpn_name:
        parser.print_help()
        sys.exit()
    if options.testmode:
        logging.info("TEST MODE ACTIVE!!!")

    settings.env = options.env.lower()

    logging.info("Connecting to appliance in %s, testmode:%s" % (settings.env, options.testmode))
    connection = SolaceAPI(settings.env, testmode=options.testmode)
    queues = connection.list_queues(options.vpn_name)
    commands = generateXMLForManagingRejectMsgToSenderOnDiscard(vpn_name=options.vpn_name, queues=queues,
                                                                reject_msg_to_sender_on_discard=options.reject_msg_to_sender_on_discard)

    print("The following queues will be manipulated in %s environment! " % settings.env)
    pprint.pprint(queues)

    s = raw_input('Do you want to continue? N/y? ')

    if s.lower() == 'y':
        for cmd in commands.commands:
            connection.rpc(str(cmd))
    else:
        print("chickening out...")