Skip to content

Commit 9c03a99

Browse files
authored
Update updateip.py
use environment variable, if set
1 parent cbb1111 commit 9c03a99

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

restconf_update_ipaddress/updateip.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import json
2626
import requests
2727
import sys
28+
import os
2829
from argparse import ArgumentParser
2930
from collections import OrderedDict
3031
from getpass import getpass
@@ -171,7 +172,9 @@ def main():
171172
help='sandbox web port', default=443)
172173
args = parser.parse_args()
173174

174-
password = getpass()
175+
password = os.getenv('DEVNET_RESTCONF_PASSWORD')
176+
if password is None:
177+
password = getpass()
175178

176179
# Create the base URL for RESTCONF calls
177180

0 commit comments

Comments
 (0)