anaconda / ae5-tools

A command-line tool for scripting AE5 actions
https://www.anaconda.com/enterprise/
BSD 3-Clause "New" or "Revised" License
9 stars 8 forks source link

Do not require lastLogin info for impersonation #139

Closed philippjfr closed 2 years ago

philippjfr commented 2 years ago

Currently the AEAdminSession.user_list and AEAdminSession.user_info calls include information about the last login. To obtain that information it queries ALL login events, which, on a long running cluster, can amount to 100s of thousands or even millions of records and slow the process down. Therefore I've added a keyword argument to control whether to include the login info. Since the AEAdminSession.impersonate call does not need this information it also sets include_login=False.

jlstevens commented 2 years ago

I think this makes a lot of sense. As a concrete example, skipping the event processing took the login time to 1 second down from six minutes!

jlstevens commented 2 years ago

I've rebased against latest master to pick up the updated unit tests so I can make sure the tests pass locally.

jlstevens commented 2 years ago

I've now run the tests locally and they are all passing (with 4 expected failures):

image

@mcg1969 Ready to merge!