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

AOU - unable to create safes based on template safe #386

Open
1 of 3 tasks
NathTheDude opened this issue Nov 29, 2023 · 0 comments
Open
1 of 3 tasks

AOU - unable to create safes based on template safe #386

NathTheDude opened this issue Nov 29, 2023 · 0 comments
Labels

Comments

@NathTheDude
Copy link

NathTheDude commented Nov 29, 2023

Summary

Although selecting -templatesafe parameter when running this script, no new safes are created for accounts when the safe does not exist already.

Steps to Reproduce

  1. Run the AOU script including the parameters -create and -templatesafe

Expected Results

Script reads a line for an account to be onboarded
script should check if safe exists
If safe exists, carry on and check if account already exists and then onboard account if unique
if safe does not exist, create a new safe
carry on going through csv for each account on there.

Actual Results

When attempting to onboard an account where the safe does not already exist, the logic seems to fail. If the safe does ot does not exist the output in the debug log states 'Safe exists.

Seems like the logic for the function 'Test-Safe' is bad with $true always being returned
try { If ($null -eq $(Get-Safe -safeName $safeName -ErrAction "SilentlyContinue")) { # Safe does not exist Write-LogMessage -Type Warning -MSG "Safe $safeName does not exist" return $false } else { # Safe exists Write-LogMessage -Type Info -MSG "Safe $safeName exists" return $true } } catch { Write-LogMessage -Type Error -MSG "Error testing safe '$safeName' existence. Error: $(Join-ExceptionMessage $_.Exception)" -ErrorAction "SilentlyContinue" }

Reproducible

  • Always
  • Sometimes
  • Non-Reproducible

Version/Tag number

What version of the product are you running? Any version info that you can
share is helpful. For example, you might give the version from Docker logs,
the Docker tag, a specific download URL, the output of the /info route, etc.

Environment setup

  • Can you describe the environment in which this product is running? Is it running on a VM / in a container / in a cloud?
  • Which cloud provider? Which container orchestrator (including version)?
  • The more info you can share about your runtime environment, the better we may be able to reproduce the issue.

Additional Information

Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant