Skip to content

Commit

Permalink
Merge pull request #347 from rackerlabs/tshooting-20240925
Browse files Browse the repository at this point in the history
chore: pretty print undersync's response
  • Loading branch information
skrobul authored Sep 25, 2024
2 parents eb8531b + 37b9fd8 commit 5980e6f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import argparse
import os
from pprint import pprint
import sys
from uuid import UUID

import requests

from understack_workflows.helpers import boolean_args
Expand Down Expand Up @@ -49,9 +51,12 @@ def update_nautobot_for_provisioning(
device_id, interface_mac, new_status
)
vlan_group_id = vlan_group_id_for(interface.device.id, nautobot)
logger.debug(f"Switch interface {interface.device} {interface} found in {vlan_group_id=}")
logger.debug(
f"Switch interface {interface.device} {interface} found in {vlan_group_id=}"
)
return vlan_group_id


def vlan_group_id_for(device_id, nautobot):
result = nautobot.session.graphql.query(
'{device(id: "%s") { rel_vlan_group_to_devices {id}}}' % device_id
Expand Down Expand Up @@ -155,7 +160,7 @@ def main():

vlan_group_id = update_nautobot(args)
response = call_undersync(args, vlan_group_id)
logger.info(f"Undersync returned: {response.json()}")
logger.info(f"Undersync returned: {pprint(response.json())}")


if __name__ == "__main__":
Expand Down

0 comments on commit 5980e6f

Please sign in to comment.