Merge remote-tracking branch 'origin/4.15'

This commit is contained in:
Rohit Yadav 2021-04-07 11:41:16 +05:30
commit ecc18163ca
7 changed files with 62 additions and 39 deletions

18
pom.xml
View File

@ -165,7 +165,7 @@
<cs.servicemix.version>3.4.4_1</cs.servicemix.version>
<cs.servlet.version>4.0.1</cs.servlet.version>
<cs.tomcat-embed-core.version>8.5.61</cs.tomcat-embed-core.version>
<cs.trilead.version>1.0.0-build222</cs.trilead.version>
<cs.trilead.version>build-217-jenkins-27</cs.trilead.version>
<cs.vmware.api.version>6.7</cs.vmware.api.version>
<cs.winrm4j.version>0.5.0</cs.winrm4j.version>
<cs.xapi.version>6.2.0-3.1</cs.xapi.version>
@ -334,7 +334,7 @@
<version>${cs.xstream.version}</version>
</dependency>
<dependency>
<groupId>com.trilead</groupId>
<groupId>org.jenkins-ci</groupId>
<artifactId>trilead-ssh2</artifactId>
<version>${cs.trilead.version}</version>
</dependency>
@ -739,6 +739,20 @@
</dependency>
</dependencies>
<repositories>
<repository>
<id>repo.jenkins-ci.org.releases</id>
<url>http://repo.jenkins-ci.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>repo.jenkins-ci.org.public</id>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<build>
<defaultGoal>install</defaultGoal>
<plugins>

View File

@ -1107,6 +1107,14 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
* This will be checked again at the hypervisor level where we can see
* the actual disk size.
*/
if (currentSize > newSize) {
VolumeVO vol = _volsDao.findById(cmd.getEntityId());
if (vol != null && ImageFormat.QCOW2.equals(vol.getFormat()) && !Volume.State.Allocated.equals(volume.getState())) {
String message = "Unable to shrink volumes of type QCOW2";
s_logger.warn(message);
throw new InvalidParameterValueException(message);
}
}
if (currentSize > newSize && !shrinkOk) {
throw new InvalidParameterValueException("Going from existing size of " + currentSize + " to size of " + newSize + " would shrink the volume."
+ "Need to sign off by supplying the shrinkok parameter with value of true.");

View File

@ -37,7 +37,7 @@
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>com.trilead</groupId>
<groupId>org.jenkins-ci</groupId>
<artifactId>trilead-ssh2</artifactId>
</dependency>
<dependency>

View File

@ -222,13 +222,13 @@ export default {
this.$emit('stepError', step, this.stepData)
}
},
trafficLabelParam (trafficTypeID, physicalNetworkID) {
trafficLabelParam (trafficTypeID, physicalNetworkIndex) {
const hypervisor = this.prefillContent.hypervisor.value
physicalNetworkID = this.isAdvancedZone ? physicalNetworkID : 0
physicalNetworkIndex = this.isAdvancedZone ? physicalNetworkIndex : 0
let physicalNetwork = []
let trafficConfig = null
if (this.prefillContent.physicalNetworks) {
physicalNetwork = this.prefillContent.physicalNetworks[0].traffics.filter(traffic => traffic.type === trafficTypeID)
physicalNetwork = this.prefillContent.physicalNetworks[physicalNetworkIndex].traffics.filter(traffic => traffic.type === trafficTypeID)
trafficConfig = physicalNetwork.length > 0 ? physicalNetwork[0] : null
}
let trafficLabel
@ -476,13 +476,13 @@ export default {
try {
if (!this.stepData.stepMove.includes('addTrafficType' + index + key)) {
if (traffic.type === 'public') {
await this.addTrafficType('Public')
await this.addTrafficType('Public', index)
} else if (traffic.type === 'management') {
await this.addTrafficType('Management')
await this.addTrafficType('Management', index)
} else if (traffic.type === 'guest') {
await this.addTrafficType('Guest')
await this.addTrafficType('Guest', index)
} else if (traffic.type === 'storage') {
await this.addTrafficType('Storage')
await this.addTrafficType('Storage', index)
}
this.stepData.stepMove.push('addTrafficType' + index + key)
}
@ -1605,8 +1605,8 @@ export default {
})
})
},
addTrafficType (trafficType) {
const getTrafficParams = this.trafficLabelParam(trafficType.toLowerCase())
addTrafficType (trafficType, index) {
const getTrafficParams = this.trafficLabelParam(trafficType.toLowerCase(), index)
let params = {}
params.trafficType = trafficType

View File

@ -60,31 +60,6 @@
<a-icon type="delete" class="traffic-type-action" @click="deleteTraffic(record.key, traffic, $event)"/>
</a-tag>
</div>
<a-modal
:title="$t('label.edit.traffic.type')"
:visible="showEditTraffic"
:closable="true"
:maskClosable="false"
:okText="$t('label.ok')"
:cancelText="$t('label.cancel')"
@ok="updateTrafficLabel(trafficInEdit)"
@cancel="cancelEditTraffic"
centered
>
<a-form :form="form">
<span class="ant-form-text"> {{ $t('message.edit.traffic.type') }} </span>
<a-form-item v-bind="formItemLayout" style="margin-top:16px;" :label="$t('label.traffic.label')">
<a-input
v-decorator="['trafficLabel', {
rules: [{
required: true,
message: $t('message.error.traffic.label'),
}]
}]"
/>
</a-form-item>
</a-form>
</a-modal>
<div v-if="isShowAddTraffic(record.traffics)">
<div class="traffic-select-item" v-if="addingTrafficForKey === record.key">
<a-select
@ -162,6 +137,31 @@
>
<span>{{ $t('message.required.traffic.type') }}</span>
</a-modal>
<a-modal
:title="$t('label.edit.traffic.type')"
:visible="showEditTraffic"
:closable="true"
:maskClosable="false"
:okText="$t('label.ok')"
:cancelText="$t('label.cancel')"
@ok="updateTrafficLabel(trafficInEdit)"
@cancel="cancelEditTraffic"
centered
>
<a-form :form="form">
<span class="ant-form-text"> {{ $t('message.edit.traffic.type') }} </span>
<a-form-item v-bind="formItemLayout" style="margin-top:16px;" :label="$t('label.traffic.label')">
<a-input
v-decorator="['trafficLabel', {
rules: [{
required: true,
message: $t('message.error.traffic.label'),
}]
}]"
/>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>

View File

@ -79,8 +79,9 @@
<artifactId>jasypt</artifactId>
</dependency>
<dependency>
<groupId>com.trilead</groupId>
<groupId>org.jenkins-ci</groupId>
<artifactId>trilead-ssh2</artifactId>
<version>${cs.trilead.version}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>

View File

@ -260,7 +260,7 @@ public class SshHelper {
* does not have an exit status, it returns true to break the loop; otherwise, it returns
* false.
*/
protected static boolean canEndTheSshConnection(int waitResultTimeoutInMs, com.trilead.ssh2.Session sess, int conditions) throws SshException {
protected static boolean canEndTheSshConnection(int waitResultTimeoutInMs, com.trilead.ssh2.Session sess, int conditions) throws SshException, InterruptedException {
if (isChannelConditionEof(conditions)) {
int newConditions = sess.waitForCondition(ChannelCondition.EXIT_STATUS, waitResultTimeoutInMs);
throwSshExceptionIfConditionsTimeout(newConditions);