Update 'freenas_network_unlock.py'

This commit is contained in:
2019-11-09 21:35:11 -05:00
parent 23325b61d3
commit bbdbd2ec35

View File

@@ -4,11 +4,6 @@ import subprocess # For executing a shell command
import yaml # For parsing the yaml config file
import config # configuration file
for pool in config.POOLS:
print(pool)
exit()
def ping(host):
"""
Returns True if host (str) responds to a ping request.
@@ -25,9 +20,9 @@ def ping(host):
#if ping(FREENAS_HOST):
VOLUMES = requests.get(
'https://{}/api/v1.0/storage/volume/'.format(FREENAS_HOST),
auth=('root', '{}'.format(ROOT_PASSWORD)),
verify='{}'.format(CA_CERT),
'https://{}/api/v1.0/storage/volume/'.format(config.HOSTNAME),
auth=('root', '{}'.format(config.ROOT_PASSWORD)),
verify='{}'.format(config.CA_CERT_PATH),
).json()