Update 'freenas_network_unlock.py'
This commit is contained in:
@@ -12,7 +12,7 @@ import logging
|
||||
#http_client.HTTPConnection.debuglevel = 1
|
||||
|
||||
# You must initialize logging, otherwise you'll not see debug output.
|
||||
#logging.basicConfig()
|
||||
logging.basicConfig(level=logging.INFO,format='%(asctime)s - [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
||||
#logging.getLogger().setLevel(logging.DEBUG)
|
||||
#requests_log = logging.getLogger("requests.packages.urllib3")
|
||||
#requests_log.setLevel(logging.DEBUG)
|
||||
@@ -41,6 +41,7 @@ VOLUMES = requests.get(
|
||||
|
||||
for volume in VOLUMES.json():
|
||||
if volume['is_decrypted'] == False:
|
||||
logging.info('Pool {} is locked.'.format(volume['name']))
|
||||
response = requests.post(
|
||||
'https://{}/api/v1.0/storage/volume/{}/unlock/'.format(config.HOSTNAME,volume['name']),
|
||||
json={'passphrase': '{}'.format(config.POOLS[volume['name']])},
|
||||
|
||||
Reference in New Issue
Block a user