|
13 | 13 | package com.cloud.network; |
14 | 14 |
|
15 | 15 | import java.util.HashMap; |
| 16 | + |
16 | 17 | import java.util.List; |
17 | 18 | import java.util.Map; |
18 | 19 |
|
|
38 | 39 | import com.cloud.utils.db.DB; |
39 | 40 | import com.cloud.utils.db.Transaction; |
40 | 41 | import com.cloud.utils.exception.CloudRuntimeException; |
41 | | -import com.cloud.network.PortProfileVO.BindingType; |
42 | | -import com.cloud.network.PortProfileVO.PortType; |
43 | 42 | import com.cloud.network.dao.CiscoNexusVSMDeviceDao; |
44 | 43 | import com.cloud.network.dao.PortProfileDao; |
45 | | -import com.cloud.network.resource.CiscoNexusVSM; |
46 | 44 | import com.cloud.exception.ResourceInUseException; |
47 | | -import com.cloud.network.PortProfileManagerImpl; |
| 45 | +import com.cloud.utils.cisco.n1kv.vsm.NetconfHelper; |
48 | 46 |
|
49 | 47 | public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase { |
50 | 48 |
|
@@ -102,11 +100,16 @@ public CiscoNexusVSMDeviceVO addCiscoNexusVSM(long clusterId, String ipaddress, |
102 | 100 | // the VSM. |
103 | 101 | //NetconfHelper (String ip, String username, String password) |
104 | 102 |
|
105 | | - CiscoNexusVSM vsmObj = new CiscoNexusVSM(ipaddress, username, password); |
106 | | - if (!vsmObj.connectToVSM()) { |
107 | | - throw new CloudRuntimeException("Couldn't login to the specified VSM"); |
| 103 | + NetconfHelper netconfClient; |
| 104 | + try { |
| 105 | + netconfClient = new NetconfHelper(ipaddress, username, password); |
| 106 | + } catch(CloudRuntimeException e) { |
| 107 | + String msg = "Failed to connect to Nexus VSM " + ipaddress + " with credentials of user " + username; |
| 108 | + s_logger.error(msg); |
| 109 | + throw new CloudRuntimeException(msg); |
108 | 110 | } |
109 | 111 |
|
| 112 | + |
110 | 113 | // Now, go ahead and associate the cluster with this VSM. |
111 | 114 | // First, check if VSM already exists in the table "virtual_supervisor_module". |
112 | 115 | // If it's not there already, create it. |
|
0 commit comments