rhtyd commented on a change in pull request #2239: CLOUDSTACK-9993: Securing
Agents Communications
URL: https://github.com/apache/cloudstack/pull/2239#discussion_r134769242
##########
File path: agent/src/com/cloud/agent/AgentShell.java
##########
@@ -107,7 +108,16 @@ public String getPod() {
@Override
public String getHost() {
- return _host;
+ String[] hosts = _host.split(",");
+ if (_hostCounter >= hosts.length) {
+ _hostCounter = 0;
+ }
+ s_logger.info("Connecting to host: " + hosts[_hostCounter %
hosts.length]);
+ return hosts[_hostCounter++ % hosts.length];
+ }
+
+ public void setHost(final String host) {
Review comment:
For historic reasons, I simply created getters/setters for `_host`, this
method is only used for writing a unit test.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services