File tree Expand file tree Collapse file tree
header/src/main/java/org/zstack/header/network/sdncontroller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public SdnControllerInventory(SdnControllerVO vo) {
3838 this .setVendorVersion (vo .getVendorVersion ());
3939 this .setDescription (vo .getDescription ());
4040 this .setName (vo .getName ());
41- this .setIp (vo .getIp ());
41+ this .setIp (toHostAddress ( vo .getIp () ));
4242 this .setUsername (vo .getUsername ());
4343 this .setPassword (vo .getPassword ());
4444 this .setStatus (vo .getStatus ());
@@ -59,6 +59,21 @@ public static List<SdnControllerInventory> valueOf(Collection<SdnControllerVO> v
5959 return lst ;
6060 }
6161
62+ private static String toHostAddress (String endpoint ) {
63+ if (endpoint == null ) {
64+ return null ;
65+ }
66+
67+ String value = endpoint .trim ();
68+ int firstColon = value .indexOf (':' );
69+ int lastColon = value .lastIndexOf (':' );
70+ if (firstColon > 0 && firstColon == lastColon ) {
71+ return value .substring (0 , lastColon );
72+ }
73+
74+ return endpoint ;
75+ }
76+
6277 public String getUuid () {
6378 return uuid ;
6479 }
You can’t perform that action at this time.
0 commit comments