autotest: rpmserver_frontend should listen on external interface
CL:669946 sneaked in a change so that rpmserver won't always attempt to
listen on a fixed hostname. That change won't stick though, because the
server is now only listening on loopback device. Change it to listen on
the publicly known name of the server.
BUG=chromium:762233
TEST=Run rpm_client against a newly provisioned rpmserver remotely.
Change-Id: I55e31b7a3b488709f6d40453bda2f2d4306daad4
Reviewed-on: https://chromium-review.googlesource.com/675674
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
diff --git a/site_utils/rpm_control_system/rpm_dispatcher.py b/site_utils/rpm_control_system/rpm_dispatcher.py
index 036553d..7c388a9 100755
--- a/site_utils/rpm_control_system/rpm_dispatcher.py
+++ b/site_utils/rpm_control_system/rpm_dispatcher.py
@@ -64,8 +64,13 @@
self._port = port
self._lock = threading.Lock()
self._worker_dict = {}
- self._frontend_server = rpm_config.get('RPM_INFRASTRUCTURE',
- 'frontend_uri')
+ # We assume that the frontend server and dispatchers are running on the
+ # same host, and the frontend server is listening for connections from
+ # the external world.
+ frontend_server_port = rpm_config.getint('RPM_INFRASTRUCTURE',
+ 'frontend_port')
+ self._frontend_server = 'http://%s:%d' % (socket.gethostname(),
+ frontend_server_port)
logging.info('Registering this rpm dispatcher with the frontend '
'server at %s.', self._frontend_server)
client = xmlrpclib.ServerProxy(self._frontend_server)