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

Workspaces: Fix directory type #7625

Merged
merged 6 commits into from May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions moto/workspaces/models.py
Expand Up @@ -58,7 +58,8 @@
self.modification_states: List[
Dict[str, str]
] = [] # modify_workspace_properties
self.related_workspaces: List[Dict[str, str]] = [] # create_standy_workspace
# create_standy_workspace
self.related_workspaces: List[Dict[str, str]] = []
self.data_replication_settings: Dict[str, Any] = {}
# The properties of the standby WorkSpace related to related_workspaces
self.standby_workspaces_properties: List[Dict[str, Any]] = []
Expand Down Expand Up @@ -141,7 +142,13 @@
self.dns_ip_addresses = directory.dns_ip_addrs
self.customer_username = "Administrator"
self.iam_rold_id = f"arn:aws:iam::{account_id}:role/workspaces_DefaultRole"
self.directory_type = directory.directory_type
dir_type = directory.directory_type
if dir_type == "ADConnector":
self.directory_type = "AD_CONNECTOR"

Check warning on line 147 in moto/workspaces/models.py

View check run for this annotation

Codecov / codecov/patch

moto/workspaces/models.py#L147

Added line #L147 was not covered by tests
elif dir_type == "SimpleAD":
self.directory_type = "SIMPLE_AD"
else:
self.directory_type = dir_type

Check warning on line 151 in moto/workspaces/models.py

View check run for this annotation

Codecov / codecov/patch

moto/workspaces/models.py#L151

Added line #L151 was not covered by tests
self.workspace_security_group_id = security_group_id
self.state = "REGISTERED"
# Default values for workspace_creation_properties
Expand Down