Skip to content

Commit

Permalink
Changed host to url
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 committed Jan 25, 2024
1 parent 69794cf commit c9e98ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pip install -r requirements.txt
2. Change to `bin` directory and run the `generate.py` script:
```shell
cd bin
python generate.py --host https://demo.netbox.dev
python generate.py --url https://demo.netbox.dev
```

3. Update the `CHANGES.md` file with the new version of NetBox that was used to generate the pack.
Expand Down
8 changes: 4 additions & 4 deletions bin/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def main():
"""
parser = argparse.ArgumentParser()
parser.add_argument(
'--host',
'--url',
type=str,
default='https://demo.netbox.dev',
help='NetBox hostname'
Expand All @@ -238,11 +238,11 @@ def main():
)

args = parser.parse_args()
host = str(args.host).rstrip('/')
url = str(args.url).rstrip('/')

try:
print(f'Connecting to {host}...')
response = requests.get(f'{host}/api/schema?format=json', verify=args.skip_ssl)
print(f'Connecting to {url}...')
response = requests.get(f'{url}/api/schema?format=json', verify=args.skip_ssl)
response.raise_for_status()
spec = response.json()
except requests.RequestException as e:
Expand Down

0 comments on commit c9e98ed

Please sign in to comment.