mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
Merge remote-tracking branch 'apache/4.22'
This commit is contained in:
commit
26009659f9
@ -78,7 +78,7 @@ public class Networks {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String getValueFrom(URI uri) {
|
public String getValueFrom(URI uri) {
|
||||||
return uri.getAuthority();
|
return uri == null ? null : uri.getAuthority();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Vswitch("vs", String.class), LinkLocal(null, null), Vnet("vnet", Long.class), Storage("storage", Integer.class), Lswitch("lswitch", String.class) {
|
Vswitch("vs", String.class), LinkLocal(null, null), Vnet("vnet", Long.class), Storage("storage", Integer.class), Lswitch("lswitch", String.class) {
|
||||||
@ -96,7 +96,7 @@ public class Networks {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getValueFrom(URI uri) {
|
public String getValueFrom(URI uri) {
|
||||||
return uri.getSchemeSpecificPart();
|
return uri == null ? null : uri.getSchemeSpecificPart();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Mido("mido", String.class), Pvlan("pvlan", String.class),
|
Mido("mido", String.class), Pvlan("pvlan", String.class),
|
||||||
@ -177,7 +177,7 @@ public class Networks {
|
|||||||
* @return the scheme as BroadcastDomainType
|
* @return the scheme as BroadcastDomainType
|
||||||
*/
|
*/
|
||||||
public static BroadcastDomainType getSchemeValue(URI uri) {
|
public static BroadcastDomainType getSchemeValue(URI uri) {
|
||||||
return toEnumValue(uri.getScheme());
|
return toEnumValue(uri == null ? null : uri.getScheme());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -191,7 +191,7 @@ public class Networks {
|
|||||||
if (com.cloud.dc.Vlan.UNTAGGED.equalsIgnoreCase(str)) {
|
if (com.cloud.dc.Vlan.UNTAGGED.equalsIgnoreCase(str)) {
|
||||||
return Native;
|
return Native;
|
||||||
}
|
}
|
||||||
return getSchemeValue(new URI(str));
|
return getSchemeValue(str == null ? null : new URI(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -220,7 +220,7 @@ public class Networks {
|
|||||||
* @return the host part as String
|
* @return the host part as String
|
||||||
*/
|
*/
|
||||||
public String getValueFrom(URI uri) {
|
public String getValueFrom(URI uri) {
|
||||||
return uri.getHost();
|
return uri == null ? null : uri.getHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -243,7 +243,7 @@ public class Networks {
|
|||||||
* @throws URISyntaxException the string is not even an uri
|
* @throws URISyntaxException the string is not even an uri
|
||||||
*/
|
*/
|
||||||
public static String getValue(String uriString) throws URISyntaxException {
|
public static String getValue(String uriString) throws URISyntaxException {
|
||||||
return getValue(new URI(uriString));
|
return getValue(uriString == null ? null : new URI(uriString));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -37,6 +37,24 @@ public class NetworksTest {
|
|||||||
public void setUp() {
|
public void setUp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void nullBroadcastDomainTypeTest() throws URISyntaxException {
|
||||||
|
BroadcastDomainType type = BroadcastDomainType.getTypeOf(null);
|
||||||
|
Assert.assertEquals("a null uri should mean a broadcasttype of undecided", BroadcastDomainType.UnDecided, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void nullBroadcastDomainTypeValueTest() {
|
||||||
|
URI uri = null;
|
||||||
|
Assert.assertNull(BroadcastDomainType.getValue(uri));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void nullBroadcastDomainTypeStringValueTest() throws URISyntaxException {
|
||||||
|
String uriString = null;
|
||||||
|
Assert.assertNull(BroadcastDomainType.getValue(uriString));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void emptyBroadcastDomainTypeTest() throws URISyntaxException {
|
public void emptyBroadcastDomainTypeTest() throws URISyntaxException {
|
||||||
BroadcastDomainType type = BroadcastDomainType.getTypeOf("");
|
BroadcastDomainType type = BroadcastDomainType.getTypeOf("");
|
||||||
|
|||||||
@ -1689,7 +1689,11 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
|
|||||||
*/
|
*/
|
||||||
srcFile = new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(srcPool, sourcePath));
|
srcFile = new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(srcPool, sourcePath));
|
||||||
srcFile.setFormat(sourceFormat);
|
srcFile.setFormat(sourceFormat);
|
||||||
|
if (destPool.getType() == StoragePoolType.RBD) {
|
||||||
|
destFile = new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(destPool, destPath));
|
||||||
|
} else {
|
||||||
destFile = new QemuImgFile(destPath);
|
destFile = new QemuImgFile(destPath);
|
||||||
|
}
|
||||||
destFile.setFormat(destFormat);
|
destFile.setFormat(destFormat);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -1997,8 +1997,13 @@ export default {
|
|||||||
},
|
},
|
||||||
onSearch (opts) {
|
onSearch (opts) {
|
||||||
const query = Object.assign({}, this.$route.query)
|
const query = Object.assign({}, this.$route.query)
|
||||||
const searchFilters = this.$route?.meta?.searchFilters || []
|
let searchFilters = this.$route?.meta?.searchFilters || []
|
||||||
|
if (typeof searchFilters === 'function') {
|
||||||
|
searchFilters = searchFilters()
|
||||||
|
}
|
||||||
|
if (Array.isArray(searchFilters)) {
|
||||||
searchFilters.forEach(key => delete query[key])
|
searchFilters.forEach(key => delete query[key])
|
||||||
|
}
|
||||||
delete query.name
|
delete query.name
|
||||||
delete query.templatetype
|
delete query.templatetype
|
||||||
delete query.keyword
|
delete query.keyword
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user