Skip to content

Commit

Permalink
Revert the config change
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-richey committed Sep 13, 2024
1 parent 2a003db commit f0f5f5c
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions datadog_sync/utils/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,20 @@ async def init_async(self, cmd: Command):
for resource in self.resources.values():
await resource.init_async()

# Attempt to validate the clients.
# For import we require validation of the source client.
# For sync/diffs we require validate the destination client.
# Validate the clients. For import we only validate the source client
# For sync/diffs we validate the destination client.
if self.validate:
try:
await _validate_client(self.destination_client)
self.logger.info("destination client validated successfully")
except Exception:
if cmd in [Command.SYNC, Command.DIFFS]:
if cmd in [Command.SYNC, Command.DIFFS]:
try:
await _validate_client(self.destination_client)
except Exception:
exit(1)
try:
await _validate_client(self.source_client)
self.logger.info("source client validated successfully")
except Exception:
if cmd == Command.IMPORT:
if cmd == Command.IMPORT:
try:
await _validate_client(self.source_client)
except Exception:
exit(1)
self.logger.info("clients validated successfully")

async def exit_async(self):
await self.source_client._end_session()
Expand Down

0 comments on commit f0f5f5c

Please sign in to comment.