mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
Merge remote-tracking branch 'apache/4.20' into 4.22
This commit is contained in:
commit
2941b518ba
@ -78,7 +78,7 @@ public class Networks {
|
||||
}
|
||||
@Override
|
||||
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) {
|
||||
@ -96,7 +96,7 @@ public class Networks {
|
||||
*/
|
||||
@Override
|
||||
public String getValueFrom(URI uri) {
|
||||
return uri.getSchemeSpecificPart();
|
||||
return uri == null ? null : uri.getSchemeSpecificPart();
|
||||
}
|
||||
},
|
||||
Mido("mido", String.class), Pvlan("pvlan", String.class),
|
||||
@ -177,7 +177,7 @@ public class Networks {
|
||||
* @return the scheme as BroadcastDomainType
|
||||
*/
|
||||
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)) {
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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() {
|
||||
}
|
||||
|
||||
@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
|
||||
public void emptyBroadcastDomainTypeTest() throws URISyntaxException {
|
||||
BroadcastDomainType type = BroadcastDomainType.getTypeOf("");
|
||||
|
||||
@ -1997,8 +1997,13 @@ export default {
|
||||
},
|
||||
onSearch (opts) {
|
||||
const query = Object.assign({}, this.$route.query)
|
||||
const searchFilters = this.$route?.meta?.searchFilters || []
|
||||
searchFilters.forEach(key => delete query[key])
|
||||
let searchFilters = this.$route?.meta?.searchFilters || []
|
||||
if (typeof searchFilters === 'function') {
|
||||
searchFilters = searchFilters()
|
||||
}
|
||||
if (Array.isArray(searchFilters)) {
|
||||
searchFilters.forEach(key => delete query[key])
|
||||
}
|
||||
delete query.name
|
||||
delete query.templatetype
|
||||
delete query.keyword
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user