mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
CLOUDSTACK-227: Fix NPE and throw an exception if the network is not found in Xen
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
f0c3b4c62a
commit
8f6fdc3efc
@ -4333,8 +4333,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
|
||||
}
|
||||
XsLocalNetwork storageNic1 = null;
|
||||
storageNic1 = getNetworkByName(conn, _storageNetworkName1);
|
||||
_host.storageNetwork1 = storageNic1.getNetworkRecord(conn).uuid;
|
||||
_host.storagePif1 = storageNic1.getPifRecord(conn).uuid;
|
||||
if (storageNic1 == null) {
|
||||
s_logger.warn("Unable to find storage network " + _storageNetworkName1 + " for host " + _host.ip);
|
||||
throw new IllegalArgumentException("Unable to find storage network " + _storageNetworkName1 + " for host " + _host.ip);
|
||||
} else {
|
||||
_host.storageNetwork1 = storageNic1.getNetworkRecord(conn).uuid;
|
||||
_host.storagePif1 = storageNic1.getPifRecord(conn).uuid;
|
||||
}
|
||||
|
||||
XsLocalNetwork storageNic2 = null;
|
||||
if (_storageNetworkName2 != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user