Update 'freenas_network_unlock.py'
This commit is contained in:
@@ -49,15 +49,9 @@ def request(resource, method='GET', data=None):
|
||||
|
||||
#if ping(config.HOSTNAME):
|
||||
POOLS = request('storage/volume/', 'GET')
|
||||
logging.debug('POOL Information: {}'.format(POOLS))
|
||||
#VOLUMES = requests.get(
|
||||
# 'https://{}/api/v1.0/storage/volume/'.format(config.HOSTNAME),
|
||||
# auth=('root', '{}'.format(config.ROOT_PASSWORD)),
|
||||
# verify='{}'.format(config.CA_CERT_PATH),
|
||||
#)
|
||||
|
||||
for pool in POOLS:
|
||||
if volume['is_decrypted'] == False:
|
||||
if pool['is_decrypted'] == False:
|
||||
logging.info('Pool {} is locked'.format(pool['name']))
|
||||
response = requests.post(
|
||||
'https://{}/api/v1.0/storage/volume/{}/unlock/'.format(config.HOSTNAME,pool['name']),
|
||||
|
||||
Reference in New Issue
Block a user