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'))
                     host_dict['profiles'] = profiles
                     host_dict['profiles'].insert(0, 'Do_not_install')
                     host_dict['current_profile'] = system['profile']
diff --git a/global_config.ini b/global_config.ini
index 647298c..062d347 100644
--- a/global_config.ini
+++ b/global_config.ini
@@ -203,6 +203,8 @@ password: aut0test
 fallback_profile:
 # Number of installation/reset attempts before failing it altogether
 num_attempts: 2
+# If set, we filter for installable profiles by searching profile comments for 
the host's platform
+install_server_profile_filter: True
 
 [PACKAGES]
 # Location from where download and fetch packages. You

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to