Permalink
Browse files

Make epuharness dashi sysname aware

  • Loading branch information...
1 parent 42f0767 commit ad814dfdb3da7dc299d6a3efa2e2f31b732611f5 @oldpatricka oldpatricka committed Jan 17, 2013
Showing with 6 additions and 2 deletions.
  1. +3 −1 epuharness/cli.py
  2. +3 −1 epuharness/harness.py
View
@@ -28,12 +28,14 @@ def main(argv=None):
parser.add_argument('-c', '--config', metavar='CONFIG_FILE', default=None)
parser.add_argument('-x', '--exchange', metavar='EXCHANGE_NAME',
default=None)
+ parser.add_argument('-s', '--sysname', metavar='SYSNAME',
+ default=None)
parser.add_argument('action', metavar='ACTION', help='start or stop')
parser.add_argument('extras', help='deployment config file for start, or services to stop',
default=[], nargs='*')
args = parser.parse_args(argv)
- epuharness = EPUHarness(exchange=args.exchange, config=args.config)
+ epuharness = EPUHarness(exchange=args.exchange, config=args.config, sysname=args.sysname)
action = args.action.lower()
if action == 'start':
@@ -28,20 +28,22 @@ class EPUHarness(object):
"""EPUHarness. Sets up Process Dispatchers and EEAgents for testing.
"""
- def __init__(self, exchange=None, pidantic_dir=None, amqp_uri=None, config=None):
+ def __init__(self, exchange=None, pidantic_dir=None, amqp_uri=None, config=None, sysname=None):
configs = ["epuharness"]
config_files = get_config_paths(configs)
if config:
config_files.append(config)
self.CFG = bootstrap.configure(config_files)
+ self.sysname = sysname
self.logdir = self.CFG.epuharness.logdir
self.pidantic_dir = (pidantic_dir or
os.environ.get('EPUHARNESS_PERSISTENCE_DIR') or
self.CFG.epuharness.pidantic_dir)
self.exchange = exchange or self.CFG.server.amqp.get('exchange', None) or str(uuid.uuid4())
self.CFG.server.amqp.exchange = self.exchange
+ self.CFG.dashi.sysname = sysname
self.dashi = bootstrap.dashi_connect(self.CFG.dashi.topic, self.CFG, amqp_uri=amqp_uri)
self.amqp_cfg = dict(self.CFG.server.amqp)

0 comments on commit ad814df

Please sign in to comment.