added commands to restart services on pool unlock too
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user