Update 'freenas_network_unlock.py'

This commit is contained in:
2019-11-11 20:28:15 -05:00
parent 28456ea351
commit 30515de1a5

View File

@@ -27,13 +27,13 @@ VOLUMES = requests.get(
for volume in VOLUMES:
if volume['is_decrypted'] == False:
#request.post(
# 'https://{}/api/v1.0/storage/volume/{}/unlock/'.format(config.HOSTNAME,volume.name),
# data={'passphrase': '{}'.format(config.POOLS[volume.name])},
# auth=('root', '{}'.format(config.ROOT_PASSWORD)),
# verify='{}'.format(config.CA_CERT_PATH),
#).json()
print(config.POOLS[volume[name]])
response = request.post(
'https://{}/api/v1.0/storage/volume/{}/unlock/'.format(config.HOSTNAME,volume['name']),
data={'passphrase': '{}'.format(config.POOLS[volume['name']])},
auth=('root', '{}'.format(config.ROOT_PASSWORD)),
verify='{}'.format(config.CA_CERT_PATH),
).json()
print(response)
#else:
#print("Host,{}, is not online".format(FREENAS_HOST))