Skip to content

Commit

Permalink
remove missed print call
Browse files Browse the repository at this point in the history
  • Loading branch information
peters-david committed Dec 18, 2024
1 parent fa57db5 commit 8fa6003
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def sync_projects(client, path, logger):
"""

logger.info("Syncing projects")
target_projects_string = await fill_template(client, path)
target_projects_string = await fill_template(client, path, logger)
target_projects = json.loads(target_projects_string)
current_projects = await client.get_projects(limit=None)
current_project_names = [
Expand Down
2 changes: 1 addition & 1 deletion src/retention_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def sync_retention_policies(client, path, logger):
"""

logger.info("Syncing retention policies")
retention_policies_string = await fill_template(client, path)
retention_policies_string = await fill_template(client, path, logger)
retention_policies = json.loads(retention_policies_string)
for retention_policy in retention_policies:
retention_scope = retention_policy["scope"]["ref"]
Expand Down
4 changes: 2 additions & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_member_id(members: [ProjectMemberEntity], username: str) -> int | None:
return None


async def fill_template(client, path: str) -> str:
async def fill_template(client, path: str, logger) -> str:
"""Takes the path to a template file and returns its content with the
replaced ids
"""
Expand All @@ -78,7 +78,7 @@ async def fill_template(client, path: str) -> str:
placeholders = re.findall(
r'{{[ ]*(?:project|registry):[A-z,0-9,.,\-,_]+[ ]*}}', content
)
print(f"Found id templates: {placeholders}")
logger.info("Found id templates", extra={"placeholders": placeholders})
placeholders = [
placeholder.replace('{{', '').replace(' ', '').replace('}}', '')
for placeholder in placeholders
Expand Down

0 comments on commit 8fa6003

Please sign in to comment.