Skip to content

Commit

Permalink
Add ability to detect if using JMX based on metadata (#3330)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmuesch authored Mar 20, 2019
1 parent 0a47b11 commit 6876c7b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def start(ctx, check, env, agent, dev, base, env_vars):

echo_waiting('Setting up environment `{}`... '.format(env), nl=False)
config, metadata, error = start_environment(check, env)

if error:
echo_failure('failed!')
echo_waiting('Stopping the environment...')
Expand All @@ -83,6 +84,7 @@ def start(ctx, check, env, agent, dev, base, env_vars):
echo_success('success!')

env_type = metadata['env_type']
use_jmx = metadata.get('use_jmx', False)

# Support legacy config where agent5 and agent6 were strings
agent_ver = ctx.obj.get('agent{}'.format(agent), agent)
Expand All @@ -96,6 +98,9 @@ def start(ctx, check, env, agent, dev, base, env_vars):
else:
agent_build = agent_ver.get(env_type, env_type)

if not isinstance(agent_ver, string_types) and use_jmx:
agent_build = '{}-jmx'.format(agent_build)

interface = derive_interface(env_type)
if interface is None:
echo_failure('`{}` is an unsupported environment type.'.format(env_type))
Expand Down

0 comments on commit 6876c7b

Please sign in to comment.