Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Change dashi messaging to use sysnames #486

Merged
merged 1 commit into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 18, 2013
  1. @oldpatricka
This page is out of date. Refresh to see the latest.
View
5 ion/agents/cei/high_availability_agent.py
@@ -7,6 +7,7 @@
from pyon.event.event import EventSubscriber
from pyon.public import log, get_sys_name
from pyon.core.exception import BadRequest, Timeout, NotFound
+from pyon.core import bootstrap
from interface.objects import AgentCommand, ProcessSchedule, \
ProcessStateEnum, ProcessQueueingMode, ProcessTarget, \
@@ -259,8 +260,8 @@ class HADashiHandler(object):
"""
def __init__(self, agent, dashi_name, dashi_uri, dashi_exchange):
self.agent = agent
-
- self.dashi = self._get_dashi(dashi_name, dashi_uri, dashi_exchange)
+ self.CFG = agent.CFG
+ self.dashi = self._get_dashi(dashi_name, dashi_uri, dashi_exchange, sysname=self.CFG.get_safe('dashi.sysname'))
self.dashi.handle(self.status)
self.dashi.handle(self.reconfigure_policy)
View
6 ion/agents/cei/test/test_haagent.py
@@ -17,6 +17,8 @@
from pyon.util.context import LocalContextMixin
from pyon.core import bootstrap
from pyon.core.exception import BadRequest
+from pyon.core import bootstrap
+from pyon.public import CFG
from ion.agents.cei.high_availability_agent import HighAvailabilityAgentClient
from ion.services.cei.test import ProcessStateWaiter, get_dashi_uri_from_cfg
@@ -97,7 +99,7 @@ def setUp(self):
self._haa_name = "high_availability_agent"
self._haa_dashi_name = "dashi_haa_" + uuid4().hex
self._haa_dashi_uri = get_dashi_uri_from_cfg()
- self._haa_dashi_exchange = "%s.hatests" % bootstrap.get_sys_name()
+ self._haa_dashi_exchange = "hatests"
self._haa_config = {
'highavailability': {
'policy': {
@@ -286,7 +288,7 @@ def test_dashi(self):
import dashi
dashi_conn = dashi.DashiConnection("something", self._haa_dashi_uri,
- self._haa_dashi_exchange)
+ self._haa_dashi_exchange, sysname=CFG.get_safe("dashi.sysname"))
status = dashi_conn.call(self._haa_dashi_name, "status")
assert status in ('PENDING', 'READY', 'STEADY')
View
8 ion/services/cei/process_dispatcher_service.py
@@ -175,7 +175,8 @@ def on_init(self):
except AttributeError, e:
log.warn("Needed Process Dispatcher config not found: %s", e)
raise
- self.dashi = get_dashi(dashi_name, uri, exchange)
+ self.dashi = get_dashi(dashi_name, uri, exchange,
+ sysname=self.CFG.get_safe('dashi.sysname'))
else:
self.dashi = None
@@ -820,7 +821,8 @@ def __init__(self, conf, service):
log.warn("Needed Process Dispatcher config not found: %s", e)
raise
- self.dashi = get_dashi(dashi_name, uri, exchange)
+ self.dashi = get_dashi(dashi_name, uri, exchange,
+ sysname=self.CFG.get_safe('dashi.sysname'))
dashi_name = self.dashi.name
@@ -1085,4 +1087,4 @@ def get_dashi(*args, **kwargs):
def get_pd_dashi_name():
- return "%s.dashi_process_dispatcher" % bootstrap.get_sys_name()
+ return "process_dispatcher"
View
6 ion/services/cei/test/test_process_dispatcher.py
@@ -714,6 +714,8 @@ class ProcessDispatcherEEAgentIntTest(ProcessDispatcherServiceIntTest):
def setUp(self):
self.dashi = None
self._start_container()
+ from pyon.public import CFG
+
self.container_client = ContainerAgentClient(node=self.container.node,
name=self.container.name)
self.container = self.container_client._get_container_instance()
@@ -739,7 +741,9 @@ def setUp(self):
self.dashi = get_dashi(uuid.uuid4().hex,
pd_config['processdispatcher']['dashi_uri'],
- pd_config['processdispatcher']['dashi_exchange'])
+ pd_config['processdispatcher']['dashi_exchange'],
+ sysname=CFG.get_safe("dashi.sysname")
+ )
#send a fake node_state message to PD's dashi binding.
self.node1_id = uuid.uuid4().hex
Something went wrong with that request. Please try again.