added commands to restart services on pool unlock too

This commit is contained in:
2023-04-01 22:59:02 -04:00
parent 736b3b6d4c
commit 8050d080cb

View File

@@ -442,6 +442,11 @@ if __name__ == '__main__':
response = request('pool/id/{}/unlock'.format(pool['id']), api_key, 'POST', {'passphrase': '{}'.format(pool_passphrase), 'services_restart': ['cifs', 'nfs']})
if response['ok']:
logger.info('Pool {} was unlocked successfully'.format(pool['name']))
# restart services since the dataset was unlocked
logger.info('Restarting the NFS service')
response = request('service/restart', api_key, 'POST', {'service': 'nfs'})
logger.info('Restarting the CIFS/SMB service')
response = request('service/restart', api_key, 'POST', {'service': 'cifs'})
else:
logger.error('Pool {} was NOT unlocked successfully'.format(pool['name']))
else: