public int getExitCode(String hostname, String role) {
    return hostRoleCommands.get(getSafeHost(hostname)).get(role).getExitCode();
  }
@param hostname    the hostname; {@code null} for a server-side stage
@param role        the role
@return the exit code
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java