Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check props exists #33

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Traits/Soap/SoapImportApis.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation
'version' => $configSpec->version ?? null,
'uuid' => $configSpec->uuid ?? null,
'guestId' => $configSpec->guestId ?? null,
'files' => $configSpec->files ? new VirtualMachineFileInfo([
'files' => isset($configSpec->files) ? new VirtualMachineFileInfo([
'vmPathName' => $configSpec->files->vmPathName ?? null,
'snapshotDirectory' => $configSpec->files->snapshotDirectory ?? null,
'suspendDirectory' => $configSpec->files->suspendDirectory ?? null,
'logDirectory' => $configSpec->files->logDirectory ?? null,
'ftMetadataDirectory' => $configSpec->files->ftMetadataDirectory ?? null,
]) : null,
'tools' => $configSpec->tools ? new ToolsConfigInfo([
'tools' => isset($configSpec->tools) ? new ToolsConfigInfo([
'toolsVersion' => $configSpec->tools->toolsVersion ?? null,
'toolsInstallType' => $configSpec->tools->toolsInstallType ?? null,
'afterPowerOn' => $configSpec->tools->afterPowerOn ?? null,
Expand All @@ -138,7 +138,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation
'lastInstallInfo' => $configSpec->tools->lastInstallInfo ?? null,

]) : null,
'flags' => $configSpec->flags ? new VirtualMachineFlagInfo([
'flags' => isset($configSpec->flags) ? new VirtualMachineFlagInfo([
'disableAcceleration' => $configSpec->flags->disableAcceleration ?? null,
'enableLogging' => $configSpec->flags->enableLogging ?? null,
'useToe' => $configSpec->flags->useToe ?? null,
Expand All @@ -157,7 +157,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation
'vvtdEnabled' => $configSpec->flags->vvtdEnabled ?? null,
'vbsEnabled' => $configSpec->flags->vbsEnabled ?? null,
]) : null,
'numCPUs' => $configSpec->numCPUs ?? null,
'numCPUs' => isset($configSpec->numCPUs) ?? null,
'numCoresPerSocket' => $configSpec->numCoresPerSocket ?? null,
'memoryMB' => $configSpec->memoryMB ?? null,
'memoryHotAddEnabled' => $configSpec->memoryHotAddEnabled ?? null,
Expand All @@ -176,7 +176,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation
] : null,
] : null,
'extraConfig' => \count($extraConfig) > 0 ? $extraConfig : null,
'bootOptions' => $configSpec->bootOptions ? [
'bootOptions' => isset($configSpec->bootOptions) ? [
'bootDelay' => $configSpec->bootOptions->bootDelay ?? null,
'enterBIOSSetup' => $configSpec->bootOptions->enterBIOSSetup ?? null,
'efiSecureBootEnabled' => $configSpec->bootOptions->efiSecureBootEnabled,
Expand Down
Loading