Add root_password for request calls
forgot to add this when copying from the old script
This commit is contained in:
@@ -209,7 +209,7 @@ if __name__ == '__main__':
|
|||||||
root_password = decrypt(client, encrypted_root_password)
|
root_password = decrypt(client, encrypted_root_password)
|
||||||
logger.debug("Root password: {0}".format(root_password))
|
logger.debug("Root password: {0}".format(root_password))
|
||||||
#POOLS = request('pool', root_password, 'GET')
|
#POOLS = request('pool', root_password, 'GET')
|
||||||
POOLS = request('storage/volume/', 'GET')
|
POOLS = request('storage/volume/', root_password, 'GET')
|
||||||
for pool_name in parser.sections():
|
for pool_name in parser.sections():
|
||||||
if pool_name != 'DEFAULT':
|
if pool_name != 'DEFAULT':
|
||||||
name = pool_name
|
name = pool_name
|
||||||
@@ -221,7 +221,7 @@ if __name__ == '__main__':
|
|||||||
if pool['is_decrypted'] == False:
|
if pool['is_decrypted'] == False:
|
||||||
logger.info('Pool {0} is locked'.format(pool['name']))
|
logger.info('Pool {0} is locked'.format(pool['name']))
|
||||||
#response = request('pool/id/{0}/unlock'.format(pool['id']), root_password, 'POST', {'passphrase': '{}'.format(decrypted_key), 'services_restart': ['cifs', 'nfs']})
|
#response = request('pool/id/{0}/unlock'.format(pool['id']), root_password, 'POST', {'passphrase': '{}'.format(decrypted_key), 'services_restart': ['cifs', 'nfs']})
|
||||||
response = request('storage/volume/{}/unlock/'.format(pool['name']), 'POST', {'passphrase': '{}'.format(passphrase)})
|
response = request('storage/volume/{}/unlock/'.format(pool['name']), root_password, 'POST', {'passphrase': '{}'.format(passphrase)})
|
||||||
if response['ok']:
|
if response['ok']:
|
||||||
logger.info('Pool {} was unlocked successfully'.format(pool['name']))
|
logger.info('Pool {} was unlocked successfully'.format(pool['name']))
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user