libra/bin/mnbtest.py
Marc Pilon dd086ee5f9 [ADMIN_API] API side of Mnb Changes
These changes consist of most of the API side of the MnB work that
is needed. This is still Work In Progress.  It does not contain the
MnB code for sending usage notifications.

Change-Id: I25ca671f65272709480f9788fa6d671eabe06046
2013-11-27 16:26:48 -05:00

55 lines
1.6 KiB
Python
Executable File

#!/usr/bin/env python
##############################################################################
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################
import logging as std_logging
import time
from oslo.config import cfg
from libra.openstack.common import log as logging
from libra.common.api.mnb import update_mnb
from libra import __version__
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
CONF.register_opts([
cfg.IntOpt('testcount',
metavar='COUNT',
default=1,
help='Number of messages to send')
])
def main():
CONF(project='mnbtest', version=__version__)
logging.setup('mnbtest')
LOG.debug('Configuration:')
print "Starting Test"
print "LOG FILE = {0}".format(CONF.log_file)
LOG.info('STARTING MNBTEST')
CONF.log_opt_values(LOG, std_logging.DEBUG)
LOG.info("Calling update_mnb with {0} messages".format(CONF.testcount))
update_mnb('lbaas.instance.test', CONF.testcount, 456)
time.sleep(30)
if __name__ == "__main__":
main()