diff options
Diffstat (limited to 'yardstick/network_services/vnf_generic/vnf/base.py')
-rw-r--r-- | yardstick/network_services/vnf_generic/vnf/base.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/yardstick/network_services/vnf_generic/vnf/base.py b/yardstick/network_services/vnf_generic/vnf/base.py index c385eb6fd..fb41a4e4a 100644 --- a/yardstick/network_services/vnf_generic/vnf/base.py +++ b/yardstick/network_services/vnf_generic/vnf/base.py @@ -147,9 +147,9 @@ class TrafficGeneratorProducer(producer.MessagingProducer): This message producer must be instantiated in the process created "run_traffic" process. """ - def __init__(self, pid): + def __init__(self, _id): super(TrafficGeneratorProducer, self).__init__(messaging.TOPIC_TG, - pid=pid) + _id=_id) def tg_method_started(self, version=1): """Send a message to inform the traffic generation has started""" @@ -324,9 +324,15 @@ class GenericTrafficGen(GenericVNF): """ pass - def _setup_mq_producer(self, pid): + @staticmethod + def _setup_mq_producer(id): """Setup the TG MQ producer to send messages between processes :return: (derived class from ``MessagingProducer``) MQ producer object """ - return TrafficGeneratorProducer(pid) + return TrafficGeneratorProducer(id) + + def get_mq_producer_id(self): + """Return the MQ producer ID if initialized""" + if self._mq_producer: + return self._mq_producer.get_id() |