Skip to content

Commit

Permalink
Merge pull request #254 from ImMin5/feature-service-accont-auto-sync
Browse files Browse the repository at this point in the history
Add debug code
  • Loading branch information
ImMin5 authored Apr 12, 2024
2 parents a4fe97a + d48bafa commit a1643ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/spaceone/identity/model/workspace/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
class Workspace(MongoModel):
workspace_id = StringField(max_length=40, generate_id="workspace", unique=True)
name = StringField(max_length=255)
state = StringField(max_length=20, default="ENABLED")
state = StringField(
max_length=20, default="ENABLED", choices=["ENABLED", "DISABLED", "DELETED"]
)
tags = DictField(default=None)
created_by = StringField(max_length=255)
reference_id = StringField(max_length=255, default=None, null=True)
Expand All @@ -17,14 +19,17 @@ class Workspace(MongoModel):
domain_id = StringField(max_length=40)
created_at = DateTimeField(auto_now_add=True)
deleted_at = DateTimeField(default=None, null=True)
last_synced_at = DateTimeField(default=None, null=True)

meta = {
"updatable_fields": [
"name",
"state",
"tags",
"is_managed",
"trusted_account_id",
"deleted_at",
"last_synced_at",
],
"minimal_fields": [
"workspace_id",
Expand Down
4 changes: 4 additions & 0 deletions src/spaceone/identity/service/job_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ def _create_workspace(
domain_id=domain_id, reference_id=reference_id, is_managed=True
)

_LOGGER.debug(
f"[_create_workspace] {name} 'domain_id': {domain_id}, 'reference_id': {reference_id}, 'is_managed' :True count: {len(workspace_vos)}"
)

params = {"trusted_account_id": trusted_account_id}
if workspace_vos:
workspace_vo = workspace_vos[0]
Expand Down

0 comments on commit a1643ee

Please sign in to comment.