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

Reply via email to