I don't think Splunk 7.x supports the import splunk.entity as entity in splunklib.
I just modified getCredentials to hardcode endpoint, apiKey and auth and returned them from that function. Commented out the rest and it will start working. Not ideal but there is an issue with the entities = entity.getEntities call.
Ideally you would rewrite that function to use splunklib.client and make a call to storage_passwords to populate those 3 fields but I didn't have time to figure that out yet.
endpoint, apiKey, auth = getCredentials(sessionKey)
... View more