Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohann0617 committed Dec 21, 2024
1 parent c67808a commit d7bfbf0
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public class OracleInstanceFetcher implements Closeable {
private final ComputeClient computeClient;
private final IdentityClient identityClient;
private final WorkRequestClient workRequestClient;
private final ComputeWaiters computeWaiters;
private final VirtualNetworkClient virtualNetworkClient;
private final BlockstorageClient blockstorageClient;
private final String compartmentId;
Expand Down Expand Up @@ -104,7 +103,6 @@ public OracleInstanceFetcher(SysUserDTO user) {

workRequestClient = WorkRequestClient.builder().build(provider);
workRequestClient.setRegion(ociCfg.getRegion());
computeWaiters = computeClient.newWaiters(workRequestClient);

virtualNetworkClient = VirtualNetworkClient.builder().build(provider);
virtualNetworkClient.setRegion(ociCfg.getRegion());
Expand Down Expand Up @@ -166,7 +164,7 @@ public InstanceDetailDTO createInstanceData() {
shape, image,
subnet, networkSecurityGroup,
cloudInitScript, user);
instance = createInstance(computeWaiters, launchInstanceDetails);
instance = createInstance(computeClient.newWaiters(workRequestClient), launchInstanceDetails);
printInstance(computeClient, virtualNetworkClient, instance, instanceDetailDTO);

log.info("【开机任务】用户:[{}] ,区域:[{}] ,系统架构:[{}] 开机成功,正在为实例预配......",
Expand All @@ -178,7 +176,7 @@ public InstanceDetailDTO createInstanceData() {
instanceDetailDTO.setMemory(user.getMemory());
instanceDetailDTO.setDisk(user.getDisk());
instanceDetailDTO.setRootPassword(user.getRootPassword());
instanceDetailDTO.setShape(shape.getShape());
instanceDetailDTO.setShape(shape.getShape());
return instanceDetailDTO;
}
} catch (Exception e) {
Expand Down Expand Up @@ -1137,10 +1135,10 @@ public BootVolume getBootVolumeByInstanceId(String instanceId) {
List<AvailabilityDomain> availabilityDomains = getAvailabilityDomains(identityClient, compartmentId);
for (AvailabilityDomain availabilityDomain : availabilityDomains) {
List<String> BootVolumeIdList = computeClient.listBootVolumeAttachments(ListBootVolumeAttachmentsRequest.builder()
.availabilityDomain(availabilityDomain.getName())
.compartmentId(compartmentId)
.instanceId(instanceId)
.build()).getItems()
.availabilityDomain(availabilityDomain.getName())
.compartmentId(compartmentId)
.instanceId(instanceId)
.build()).getItems()
.stream().map(BootVolumeAttachment::getBootVolumeId)
.filter(Objects::nonNull)
.collect(Collectors.toList());
Expand Down

0 comments on commit d7bfbf0

Please sign in to comment.