diff --git a/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_compute_api.py b/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_compute_api.py index 6bd842ec..27e84658 100755 --- a/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_compute_api.py +++ b/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_compute_api.py @@ -3449,7 +3449,7 @@ class NFVIComputeAPI(nfvi.api.v1.NFVIComputeAPI): return rpc_listener.test_connection( config.CONF['amqp']['host'], config.CONF['amqp']['port'], config.CONF['amqp']['user_id'], config.CONF['amqp']['password'], - config.CONF['amqp']['virt_host'], "nova") + config.CONF['amqp']['virt_host'], "nova", "notifications.info") def initialize(self, config_file): """ diff --git a/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/rpc_listener.py b/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/rpc_listener.py index 80200a1e..4120a9fc 100755 --- a/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/rpc_listener.py +++ b/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/rpc_listener.py @@ -149,7 +149,8 @@ class RPCListener(threading.Thread): self._exit.set() -def test_connection(host, port, user_id, password, virt_host, exchange_name): +def test_connection(host, port, user_id, password, virt_host, exchange_name, + queue_name): """ Test a connection to an exchange on a virtual host """ @@ -167,6 +168,15 @@ def test_connection(host, port, user_id, password, virt_host, exchange_name): exchange = Exchange(exchange_name, channel=connection, type='topic', durable=False, passive=True) exchange.declare() + + # Check whether the queue exists - will raise exception if it + # fails. + rpc_receive_queue = Queue(queue_name, + durable=True, + exchange=exchange, + channel=connection) + rpc_receive_queue.queue_declare(passive=True) + success = True except Exception as e: DLOG.info("Unable to connect to virt_host %s, exchange %s, error: %s" %