Lucas, My 2c:
I think it is highly desirable to be able to limit the list of profiles available in autotest; In my setup we might have some profiles that we don't want to expose to atest installs on the cobbler server until they get qualified etc; Let's keep it here and think how in the near future we can actually nicely parametrize the filter string Julius -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Lucas Meneghel Rodrigues Sent: Monday, March 11, 2013 10:07 AM To: Nishanth Aravamudan Cc: [email protected] Subject: Re: [Autotest] [RFC PATCH] install_server: allow administrator to choose to filter profiles or not On Fri, Mar 8, 2013 at 9:37 PM, Nishanth Aravamudan <[email protected]> wrote: > Depending on your environment, you may not have access to Cobbler to > always manipulate the profile comments. Also, you may not want to ever > limit the user from selecting a profile, and the filtered search is > slower than just grabbing them all. So add a setting for not requiring > the filter and modify get_hosts accordingly. > > Signed-off-by: Nishanth Aravamudan <[email protected]> > > diff --git a/frontend/afe/rpc_interface.py > b/frontend/afe/rpc_interface.py index 66044f3..5e51bef 100644 > --- a/frontend/afe/rpc_interface.py > +++ b/frontend/afe/rpc_interface.py > @@ -197,6 +197,7 @@ def get_hosts(multiple_labels=(), > exclude_only_if_needed_labels=False, > install_server_info = get_install_server_info() > install_server_type = install_server_info.get('type', None) > install_server_url = install_server_info.get('xmlrpc_url', None) > + install_server_filter = > + install_server_info.get('install_server_profile_filter', None) > > if install_server_type == 'cobbler' and install_server_url: > install_server = xmlrpclib.ServerProxy(install_server_url) > @@ -234,8 +235,11 @@ def get_hosts(multiple_labels=(), > exclude_only_if_needed_labels=False, > > if host_dict['platform']: > error_encountered = False > - profile_params = {"comment":"*%s*" % > host_dict['platform']} > - profiles = install_server.find_profile(profile_params) > + if install_server_filter: > + profile_params = {"comment":"*%s*" % > host_dict['platform']} > + profiles = > install_server.find_profile(profile_params) > + else: > + profiles = > + sorted(install_server.get_item_names('profile')) Hmm, isn't it better to simply have no filtering, so one extra knob could be cut out from the code? _______________________________________________ Autotest-kernel mailing list [email protected] https://www.redhat.com/mailman/listinfo/autotest-kernel _______________________________________________ Autotest-kernel mailing list [email protected] https://www.redhat.com/mailman/listinfo/autotest-kernel
