Skip to content

Commit d8da081

Browse files
committed
Merge remote-tracking branch 'apache/4.20' into multiarchzones-improvements
Signed-off-by: Abhishek Kumar <[email protected]>
2 parents 3807f17 + 603cd84 commit d8da081

File tree

113 files changed

+2098
-1015
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+2098
-1015
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ jobs:
236236
237237
- name: Install Python dependencies
238238
run: |
239-
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid
239+
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid pynose
240240
241241
- name: Install jacoco dependencies
242242
run: |

agent/bindir/cloud-setup-agent.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ import os
2020
import logging
2121
import sys
2222
import socket
23+
24+
# ---- This snippet of code adds the sources path and the waf configured PYTHONDIR to the Python path ----
25+
# ---- We do this so cloud_utils can be looked up in the following order:
26+
# ---- 1) Sources directory
27+
# ---- 2) waf configured PYTHONDIR
28+
# ---- 3) System Python path
29+
for pythonpath in (
30+
"@PYTHONDIR@",
31+
os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"),
32+
):
33+
if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath)
34+
# ---- End snippet of code ----
35+
2336
from cloudutils.cloudException import CloudRuntimeException, CloudInternalException
2437
from cloudutils.utilities import initLoging, bash
2538
from cloudutils.configFileOps import configFileOps

agent/bindir/libvirtqemuhook.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ import sys
2020
import os
2121
import subprocess
2222
from threading import Timer
23+
24+
# ---- This snippet of code adds the sources path and the waf configured PYTHONDIR to the Python path ----
25+
# ---- We do this so cloud_utils can be looked up in the following order:
26+
# ---- 1) Sources directory
27+
# ---- 2) waf configured PYTHONDIR
28+
# ---- 3) System Python path
29+
for pythonpath in (
30+
"@PYTHONDIR@",
31+
os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"),
32+
):
33+
if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath)
34+
# ---- End snippet of code ----
35+
2336
from xml.dom.minidom import parse
2437
from cloudutils.configFileOps import configFileOps
2538
from cloudutils.networkConfig import networkConfig

api/src/main/java/com/cloud/storage/VMTemplateStorageResourceAssoc.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.cloud.storage;
1818

1919
import java.util.Date;
20+
import java.util.List;
2021

2122
import org.apache.cloudstack.api.InternalIdentity;
2223

@@ -25,6 +26,8 @@ public static enum Status {
2526
UNKNOWN, DOWNLOAD_ERROR, NOT_DOWNLOADED, DOWNLOAD_IN_PROGRESS, DOWNLOADED, ABANDONED, UPLOADED, NOT_UPLOADED, UPLOAD_ERROR, UPLOAD_IN_PROGRESS, CREATING, CREATED, BYPASSED
2627
}
2728

29+
List<Status> PENDING_DOWNLOAD_STATES = List.of(Status.NOT_DOWNLOADED, Status.DOWNLOAD_IN_PROGRESS);
30+
2831
String getInstallPath();
2932

3033
long getTemplateId();

api/src/main/java/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.cloudstack.api.command.user.iso;
1818

1919

20+
import com.cloud.dc.DataCenter;
2021
import org.apache.cloudstack.api.APICommand;
2122
import org.apache.cloudstack.api.ApiCommandResourceType;
2223
import org.apache.cloudstack.api.ApiConstants;
@@ -101,7 +102,15 @@ public long getEntityOwnerId() {
101102

102103
@Override
103104
public String getEventDescription() {
104-
return "extracting ISO: " + getId() + " from zone: " + getZoneId();
105+
String isoId = this._uuidMgr.getUuid(VirtualMachineTemplate.class, getId());
106+
String baseDescription = String.format("Extracting ISO: %s", isoId);
107+
108+
Long zoneId = getZoneId();
109+
if (zoneId == null) {
110+
return baseDescription;
111+
}
112+
113+
return String.format("%s from zone: %s", baseDescription, this._uuidMgr.getUuid(DataCenter.class, zoneId));
105114
}
106115

107116
@Override

api/src/main/java/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,15 @@ public String getEventType() {
101101

102102
@Override
103103
public String getEventDescription() {
104-
return "extracting template: " + this._uuidMgr.getUuid(VirtualMachineTemplate.class, getId()) + ((getZoneId() != null) ? " from zone: " + this._uuidMgr.getUuid(DataCenter.class, getZoneId()) : "");
104+
String templateId = this._uuidMgr.getUuid(VirtualMachineTemplate.class, getId());
105+
String baseDescription = String.format("Extracting template: %s", templateId);
106+
107+
Long zoneId = getZoneId();
108+
if (zoneId == null) {
109+
return baseDescription;
110+
}
111+
112+
return String.format("%s from zone: %s", baseDescription, this._uuidMgr.getUuid(DataCenter.class, zoneId));
105113
}
106114

107115
@Override

api/src/main/java/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.cloudstack.api.command.user.volume;
1818

1919

20+
import com.cloud.dc.DataCenter;
2021
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
2122
import org.apache.cloudstack.api.ACL;
2223
import org.apache.cloudstack.api.APICommand;
@@ -114,12 +115,15 @@ public String getEventType() {
114115

115116
@Override
116117
public String getEventDescription() {
117-
return "Extraction job";
118+
String volumeId = this._uuidMgr.getUuid(Volume.class, getId());
119+
String zoneId = this._uuidMgr.getUuid(DataCenter.class, getZoneId());
120+
121+
return String.format("Extracting volume: %s from zone: %s", volumeId, zoneId);
118122
}
119123

120124
@Override
121125
public void execute() {
122-
CallContext.current().setEventDetails("Volume Id: " + this._uuidMgr.getUuid(Volume.class, getId()));
126+
CallContext.current().setEventDetails(getEventDescription());
123127
String uploadUrl = _volumeService.extractVolume(this);
124128
if (uploadUrl != null) {
125129
ExtractResponse response = _responseGenerator.createVolumeExtractResponse(id, zoneId, getEntityOwnerId(), mode, uploadUrl);

api/src/main/java/org/apache/cloudstack/api/response/NetworkResponse.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@
2828
import org.apache.cloudstack.api.EntityReference;
2929

3030
import com.cloud.network.Network;
31-
import com.cloud.projects.ProjectAccount;
3231
import com.cloud.serializer.Param;
3332
import com.google.gson.annotations.SerializedName;
3433

3534
@SuppressWarnings("unused")
36-
@EntityReference(value = {Network.class, ProjectAccount.class})
35+
@EntityReference(value = {Network.class})
3736
public class NetworkResponse extends BaseResponseWithAssociatedNetwork implements ControlledEntityResponse, SetResourceIconResponse {
3837

3938
@SerializedName(ApiConstants.ID)

client/bindir/cloud-setup-management.in

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,27 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818

19+
import os
1920
import sys
21+
# ---- This snippet of code adds the sources path and the waf configured PYTHONDIR to the Python path ----
22+
# ---- We do this so cloud_utils can be looked up in the following order:
23+
# ---- 1) Sources directory
24+
# ---- 2) waf configured PYTHONDIR
25+
# ---- 3) System Python path
26+
for pythonpath in (
27+
"@PYTHONDIR@",
28+
os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"),
29+
):
30+
if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath)
31+
# ---- End snippet of code ----
32+
2033
from cloudutils.syscfg import sysConfigFactory
2134
from cloudutils.utilities import initLoging, UnknownSystemException
2235
from cloudutils.cloudException import CloudRuntimeException, CloudInternalException
2336
from cloudutils.globalEnv import globalEnv
2437
from cloudutils.serviceConfigServer import cloudManagementConfig
2538
from optparse import OptionParser
39+
2640
if __name__ == '__main__':
2741
initLoging("@MSLOGDIR@/setupManagement.log")
2842
glbEnv = globalEnv()

engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5240,10 +5240,9 @@ public Outcome<VirtualMachine> migrateVmAwayThroughJobQueue(final String vmUuid,
52405240
workJob = newVmWorkJobAndInfo.first();
52415241
VmWorkMigrateAway workInfo = new VmWorkMigrateAway(newVmWorkJobAndInfo.second(), srcHostId);
52425242

5243-
workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
5243+
setCmdInfoAndSubmitAsyncJob(workJob, workInfo, vmId);
52445244
}
52455245

5246-
_jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vmId);
52475246

52485247
AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
52495248

0 commit comments

Comments
 (0)