nvazquez commented on code in PR #6919:
URL: https://github.com/apache/cloudstack/pull/6919#discussion_r1046564256
##########
server/src/main/java/org/apache/cloudstack/consoleproxy/ConsoleAccessManagerImpl.java:
##########
@@ -489,6 +494,6 @@ public String getConfigComponentName() {
@Override
public ConfigKey<?>[] getConfigKeys() {
- return new ConfigKey[] { ConsoleProxyExtraSecurityValidationEnabled };
+ return new ConfigKey[] { };
Review Comment:
Done, thanks
##########
server/src/main/java/org/apache/cloudstack/consoleproxy/ConsoleAccessManagerImpl.java:
##########
@@ -207,15 +205,22 @@ private ConsoleEndpoint generateAccessEndpoint(Long vmId,
String sessionUuid, St
throw new CloudRuntimeException(msg);
}
+ String vmUuid = vm.getUuid();
+ if (unsupportedConsoleVMState.contains(vm.getState())) {
+ msg = "VM " + vmUuid + " must be running to connect console,
sending blank response for console access request";
+ s_logger.warn(msg);
+ throw new CloudRuntimeException(msg);
+ }
+
if (vm.getHostId() == null) {
- msg = "VM " + vmId + " lost host info, sending blank response for
console access request";
+ msg = "VM " + vmUuid + " lost host info, sending blank response
for console access request";
s_logger.warn(msg);
throw new CloudRuntimeException(msg);
}
HostVO host = managementServer.getHostBy(vm.getHostId());
if (host == null) {
- msg = "VM " + vmId + "'s host does not exist, sending blank
response for console access request";
+ msg = "VM " + vmUuid + "'s host does not exist, sending blank
response for console access request";
Review Comment:
Done, thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]