On 11.03.2013 [13:52:42 -0300], Lucas Meneghel Rodrigues wrote: > On Mon, Mar 11, 2013 at 11:21 AM, Lucas Meneghel Rodrigues > <[email protected]> wrote: > > On Thu, Mar 7, 2013 at 2:16 PM, Nishanth Aravamudan > > <[email protected]> wrote: > >> Use an RPC call, just like for specific hosts, for finding all possible > >> profiles. We let the user shoot themselves in the foot (that is, they > >> might select a profile that doesn't apply to that server), but that's > >> the nature of selecting by label -- unless the label is a platform, we > >> won't be able to do the lookup anyways in the install server. > > > > Fair enough. I found 2 issues during review of the patch, see below. > > > >> Update the create_job interface appropriately. > >> > >> Signed-off-by: Nishanth Aravamudan <[email protected]> > >> > >> --- > >> I have not tested the cli submission of jobs yet. I *think* it should > >> work similar to the regular host. But I need to look into it still. > >> > >> > >> diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py > >> index e316af9..8308e1e 100644 > >> --- a/frontend/afe/rpc_interface.py > >> +++ b/frontend/afe/rpc_interface.py > >> @@ -264,6 +264,50 @@ def get_num_hosts(multiple_labels=(), > >> exclude_only_if_needed_labels=False, > >> return hosts.count() > >> > >> > >> +def get_profiles(): > >> + install_server = None > >> + 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) > >> + > >> + if install_server_type == 'cobbler' and install_server_url: > >> + install_server = xmlrpclib.ServerProxy(install_server_url) > >> + > >> + error_encountered = True > >> + profile_dicts = [] > >> + if install_server is not None: > >> + profiles = install_server.get_item_names('profile') > >> + > >> + if len(profiles) < 1: > >> + msg = 'No profiles defined on install server' > >> + rpc_logger = logging.getLogger('rpc_logger') > >> + rpc_logger.info(msg, host_dict['hostname']) > > > > ^ The way this is done, it'll cause a logging exception, since there's > > no %s or similar in msg. > > Oh, I just realize there's no host_dict on that scope. I guess it was > a mistake. Just logging msg should be enough.
Yep, C&P mistake on my part, will fix. Thanks for the review! -Nish _______________________________________________ Autotest-kernel mailing list [email protected] https://www.redhat.com/mailman/listinfo/autotest-kernel
