#NEWLINE# def top( **kwargs ) : #NEWLINE# #INDENT# '\n    Look up top data in Cobbler for a minion.\n    ' #NEWLINE# url = __opts__ [ 'cobbler.url' ] #NEWLINE# user = __opts__ [ 'cobbler.user' ] #NEWLINE# password = __opts__ [ 'cobbler.password' ] #NEWLINE# minion_id = kwargs [ 'opts' ] [ 'id' ] #NEWLINE# log . info ( 'Querying cobbler for information for %r' , url ) #NEWLINE# try : #NEWLINE# #INDENT# server = salt . ext . six . moves . xmlrpc_client . Server ( url , allow_none = True ) #NEWLINE# if user : #NEWLINE# #INDENT# server . login ( user , password ) #NEWLINE# #UNINDENT# data = server . get_blended_data ( None , minion_id ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# log . exception ( 'Could not connect to cobbler.' ) #NEWLINE# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# data [ 'status' ] : data [ 'mgmt_classes' ] , #NEWLINE# #UNINDENT# }