rhtyd closed pull request #2637: config drive - send user-defined vm name as
host name, not uuid
URL: https://github.com/apache/cloudstack/pull/2637
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/api/src/com/cloud/network/NetworkModel.java
b/api/src/com/cloud/network/NetworkModel.java
index 35a6a63a992..943efac5ba2 100644
--- a/api/src/com/cloud/network/NetworkModel.java
+++ b/api/src/com/cloud/network/NetworkModel.java
@@ -73,7 +73,7 @@
AVAILABILITY_ZONE_FILE, "availability_zone",
LOCAL_HOSTNAME_FILE, "hostname",
VM_ID_FILE, "uuid",
- INSTANCE_ID_FILE, "name"
+ PUBLIC_HOSTNAME_FILE, "name"
);
static final ConfigKey<Integer> MACIdentifier = new
ConfigKey<Integer>("Advanced",Integer.class, "mac.identifier", "0",
diff --git
a/server/test/com/cloud/network/element/ConfigDriveNetworkElementTest.java
b/server/test/com/cloud/network/element/ConfigDriveNetworkElementTest.java
index 7d5041536f0..67d3208e610 100644
--- a/server/test/com/cloud/network/element/ConfigDriveNetworkElementTest.java
+++ b/server/test/com/cloud/network/element/ConfigDriveNetworkElementTest.java
@@ -104,7 +104,7 @@
private final String VMUSERDATA =
"H4sIABCvw1oAAystTi1KSSxJ5AIAUPllwQkAAAA=";
private final long SOID = 31L;
private final long HOSTID = NETWORK_ID;
- private final String HOSTNAME = "host1";
+ private final String HOSTNAME = "vm-hostname";
@Mock private ConfigurationDao _configDao;
@Mock private DataCenterDao _dcDao;
@@ -166,6 +166,7 @@ public void setUp() throws NoSuchFieldException,
IllegalAccessException {
when(virtualMachine.getDataCenterId()).thenReturn(DATACENTERID);
when(virtualMachine.getInstanceName()).thenReturn(VMINSTANCENAME);
when(virtualMachine.getUserData()).thenReturn(VMUSERDATA);
+ when(virtualMachine.getHostName()).thenReturn(HOSTNAME);
when(deployDestination.getHost()).thenReturn(hostVO);
when(hostVO.getId()).thenReturn(HOSTID);
when(nic.isDefaultNic()).thenReturn(true);
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services