Skip to content

Commit

Permalink
fix: tweaks to the trivial live test program
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelm committed Feb 14, 2022
1 parent b594669 commit 45c37c8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions utilities/test_connection.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/usr/bin/env python
import argparse
import logging

from broadworks_ocip import BroadworksAPI

logging.basicConfig(level=logging.DEBUG, filename="debug.log")
logger = logging.getLogger(__name__)


def main():
parser = argparse.ArgumentParser(
Expand All @@ -12,17 +16,23 @@ def main():
parser.add_argument("--port", type=int, default=2208)
parser.add_argument("--username", type=str, required=True)
parser.add_argument("--password", type=str, required=True)
parser.add_argument("--list", action="store_true")
args = parser.parse_args()

api = BroadworksAPI(
host=args.host,
port=args.port,
username=args.username,
password=args.password,
logger=logger,
)
result = api.command("ServiceProviderGetListRequest")
for thing in result.service_provider_table:
print(thing)
if args.list:
result = api.command("ServiceProviderGetListRequest")
for thing in result.service_provider_table:
print(thing)
else:
result = api.command("SystemSoftwareVersionGetRequest")
print(result)


if __name__ == "__main__":
Expand Down

0 comments on commit 45c37c8

Please sign in to comment.