Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitconfig/hooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ def check_commit_msg(file_path):
full_lines = 0
FAIL = False

jira_patterns = [r"\bZSTAC-\d+\b", r"\bZSTACK-\d+\b", r"\bMINI-\d+\b",
r"\bZOPS-\d+\b", r"\bZHCI-\d+\b", r"\bZSV-\d+\b"]
jira_patterns = [r"\bZSTAC-\d+\b", r"\bZSTACK-\d+\b", r"\bMINI-\d+\b",
r"\bZOPS-\d+\b", r"\bZHCI-\d+\b", r"\bZSV-\d+\b",
r"\bZCF-\d+\b", r"\bAIOS-\d+\b"]
with open(file_path, 'r', encoding='utf8') as f:
lines = f.readlines()
full_lines = len(lines)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.zstack.header.message.APIMessage;
import org.zstack.utils.ShellResult;
import org.zstack.utils.ShellUtils;
import org.zstack.utils.network.IPv6Utils;
import org.zstack.utils.network.NetworkUtils;

import static org.zstack.core.Platform.argerr;
Expand Down Expand Up @@ -121,9 +122,13 @@ private void validate(APIUpdateHostMsg msg) {
}

private void validate(APIAddHostMsg msg) {
if (!NetworkUtils.isIpv4Address(msg.getManagementIp()) && !NetworkUtils.isHostname(msg.getManagementIp())) {
throw new ApiMessageInterceptionException(argerr(ORG_ZSTACK_COMPUTE_HOST_10113, "managementIp[%s] is neither an IPv4 address nor a valid hostname", msg.getManagementIp()));
String ip = msg.getManagementIp();
if (!NetworkUtils.isHostname(ip) && !IPv6Utils.isValidManagementIp(ip)) {
throw new ApiMessageInterceptionException(argerr(ORG_ZSTACK_COMPUTE_HOST_10113,
"managementIp[%s] is not a valid IPv4/IPv6 address or hostname", ip));
}
// Normalize IPv6 to RFC 5952 compressed form; IPv4/hostname returned as-is
msg.setManagementIp(IPv6Utils.normalizeIpv6(ip));
}

private void validate(APIChangeHostStateMsg msg){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.zstack.compute.vm;

import org.zstack.core.config.GlobalConfig;
import org.zstack.core.config.GlobalConfigDefinition;
import org.zstack.core.config.GlobalConfigValidation;

/**
* GlobalConfig for VmNicLifecycleExtensionPoint routing (F-010).
*
* Defaults are declared in {@code conf/globalConfig/vmNicLifecycle.xml}.
*/
@GlobalConfigDefinition
public class VmNicLifecycleGlobalConfig {
public static final String CATEGORY = "vmNicLifecycle";

/**
* Per-implementation timeout (seconds) for {@code reconcileOnHost} during host heartbeat
* reconciliation. Default is 30s (see XML).
*/
@GlobalConfigValidation(numberGreaterThan = 0)
public static GlobalConfig RECONCILE_TIMEOUT =
new GlobalConfig(CATEGORY, "reconcileOnHost.timeout");
}
Loading