[Asterisk-code-review] Remote testsuite: make remote asterisk default ARI host (testsuite[master])
Scott Griepentrog
asteriskteam at digium.com
Fri Nov 20 12:36:38 CST 2015
Scott Griepentrog has uploaded a new change for review.
https://gerrit.asterisk.org/1665
Change subject: Remote testsuite: make remote asterisk default ARI host
......................................................................
Remote testsuite: make remote asterisk default ARI host
This change adjust the default ARI host automatically so
that it uses the remote host name when so configured.
Change-Id: Ia0d784c100fb43bbd7f949d4fcd281853cc8593d
---
M lib/python/asterisk/ari.py
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/65/1665/1
diff --git a/lib/python/asterisk/ari.py b/lib/python/asterisk/ari.py
index 1649f49..ec6b66f 100644
--- a/lib/python/asterisk/ari.py
+++ b/lib/python/asterisk/ari.py
@@ -60,7 +60,12 @@
self.apps = test_config.get('apps', 'testsuite')
if isinstance(self.apps, list):
self.apps = ','.join(self.apps)
- host = test_config.get('host', '127.0.0.1')
+ default_host = '127.0.0.1'
+ if self.global_config.config:
+ asterisks = self.global_config.config.get('asterisk-instances')
+ if asterisks:
+ default_host = asterisks[0]['host']
+ host = test_config.get('host', default_host)
port = test_config.get('port', DEFAULT_PORT)
userpass = (test_config.get('username', 'testsuite'),
test_config.get('password', 'testsuite'))
--
To view, visit https://gerrit.asterisk.org/1665
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0d784c100fb43bbd7f949d4fcd281853cc8593d
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>
More information about the asterisk-code-review
mailing list