sureshanaparti commented on a change in pull request #5750:
URL: https://github.com/apache/cloudstack/pull/5750#discussion_r778693740
##########
File path:
engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/DataMigrationUtility.java
##########
@@ -87,19 +92,22 @@
* the migration is terminated.
*/
private boolean filesReadyToMigrate(Long srcDataStoreId) {
- String[] validStates = new String[]{"Ready", "Allocated",
"Destroying", "Destroyed", "Failed"};
+ State[] validStates = {State.Ready, State.Allocated, State.Destroying,
State.Destroyed, State.Failed};
boolean isReady = true;
List<TemplateDataStoreVO> templates =
templateDataStoreDao.listByStoreId(srcDataStoreId);
for (TemplateDataStoreVO template : templates) {
- isReady &=
(Arrays.asList(validStates).contains(template.getState().toString()));
+ isReady &=
(Arrays.asList(validStates).contains(template.getState()));
+ LOGGER.trace(String.format("template state: ",
template.getState()));
}
List<SnapshotDataStoreVO> snapshots =
snapshotDataStoreDao.listByStoreId(srcDataStoreId, DataStoreRole.Image);
for (SnapshotDataStoreVO snapshot : snapshots) {
- isReady &=
(Arrays.asList(validStates).contains(snapshot.getState().toString()));
+ isReady &=
(Arrays.asList(validStates).contains(snapshot.getState()));
+ LOGGER.trace(String.format("snapshot state: ",
snapshot.getState()));
}
List<VolumeDataStoreVO> volumes =
volumeDataStoreDao.listByStoreId(srcDataStoreId);
for (VolumeDataStoreVO volume : volumes) {
- isReady &=
(Arrays.asList(validStates).contains(volume.getState().toString()));
+ isReady &=
(Arrays.asList(validStates).contains(volume.getState()));
+ LOGGER.trace(String.format("volume state: ", volume.getState()));
Review comment:
```suggestion
LOGGER.trace(String.format("volume state: %s",
volume.getState().toString()));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]