mς ώΜͺJc @sΦdkTdkTdkTd„Zd„ZeƒZd„Zd„ZdNe e d„Z e dNe d„Z dNe e d„Z e dNd„Z d efd „ƒYZd efd „ƒYZd efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZd!efd"„ƒYZd#efd$„ƒYZd%efd&„ƒYZd'efd(„ƒYZd)efd*„ƒYZd+efd,„ƒYZ d-efd.„ƒYZ!e d/ege"i#i$ei#i%e"i#i&jd0e'ƒZ(e d1ei#i)ed0e'ƒZ*e d ei#i+ed0e'ƒZ,e d2ei#i-ed0e'd3d4ƒZ.e d5ei#i/ed0e'ƒZ/e d6ei#i0ed0e'ƒZ1e d7ei#i2ed0e'ƒZ3e d8ei#i4ed0e'ƒZ5e d9ei#i6ed0e'ƒZ7e d:ei#i8ed0e'ƒZ9e d;ei#i:ed0e'ƒZ;e d<ei#i<ed0e'd3d=ƒZ<e d>ei#i=ed0e'd3d?ƒZ=e d@ei#i>ed0e'd3dAƒZ>e dBee?i#i@geAi#iBeAi#iBe?i#i%jd0e'ƒZCe dCee?i#i@geAi#iBeAi#iBe?i#i%jd0e'dDe'ƒZDdE„ZEdF„ZFdG„ZGdH„ZHdI„ZIdJ„ZJdK„ZKdL„ZLdM„ZMdNS(O(t*cCs#tiitiƒtddƒjS(NtdaysiZ(thoststct last_modifiedtdatettodayt timedelta(((t./usr/share/smolt/smoon/hardware/model/views.pytold_hosts_clausescCsttgtƒƒidƒS(Nt old_hosts(tselectRR talias(((Rtold_hosts_table scCsti|ƒidƒS(s1This is a counted column. A convenience functiontcntN(tfunctcounttcolumntlabel(R((Rt column_cntscCstiti|ƒƒidƒS(s$The same as column_cnt, but distinctRN(RRtdistinctRR(R((Rt column_cnt_dsc Csr|o t}nt}||ƒ}t|||g|ƒi|ƒ}|o|i ƒ}n|i |ƒi |ƒS(s¬Generates a satistical counted view of some table or simple join for some group of columns. This function is a bit low level, and you probably want the simple version of this: simple_mapped_counted_view params: name is the name of the view columns is an iterable with the columns desired - multiple tables' columns may be used here, for simple joins - what is in group_by should not be included here group_by the object to group on, such that it is counted restrictions are sqlalchemy where constraints desc is a boolean whether you want it in ascending, descending or condescending order N(RRtcnt_fRtgroup_bytcnt_objR tcolumnst restrictionststdesctorder_byR tname( RRRRRRRRR((Rt counted_views  "cCs9|o|i|ƒ}nt||g|d|d|ƒS(s+Generates a counted view on a single columnRRN(RRRRRR(RRRRR((Rtsimple_counted_view0sc CsJt||||||ƒ}t|i |iƒ}t ||d|gƒ|S(Nt primary_key( RRRRRRRtseltgetattrRtp_keytmappertmap_obj( RR&RRRRRR$R"((Rtmapped_counted_view8scCsat||||ƒ}|ot|i|ƒ}nt|i|iƒ}t ||d|gƒ|S(s”For some column in a table, generates a counted view and maps it to some object params: name is the name of the view column is the column being counted map_obj is the object to be mapped to desc is the order you want it in label renames the column name to something else, so the class uses a different attribute name than the source table R!N( R RRRRR"R#RR$R%R&(RRR&RRR$R"((Rtsimple_mapped_counted_view>s tFileSyscBstZRS(N(t__name__t __module__(((RR)SstArchcBstZRS(N(R*R+(((RR,VstOScBstZRS(N(R*R+(((RR-XstRunlevelcBstZRS(N(R*R+(((RR.ZstNumCPUscBstZRS(N(R*R+(((RR/\stVendorcBstZRS(N(R*R+(((RR0^stSystemcBstZRS(N(R*R+(((RR1`st CPUVendorcBstZRS(N(R*R+(((RR2bst KernelVersioncBstZRS(N(R*R+(((RR3dst FormFactorcBstZRS(N(R*R+(((RR4fstLanguagecBstZRS(N(R*R+(((RR5hst TotalListcBstZRS(N(R*R+(((RR6jst UniqueListcBstZRS(N(R*R+(((RR7lstSelinuxEnabledcBstZRS(N(R*R+(((RR8nstSelinuxEnforcedcBstZRS(N(R*R+(((RR9pst SelinuxPolicycBstZRS(N(R*R+(((RR:rstMythSystemRolecBstZRS(N(R*R+(((RR;tst MythRemotecBstZRS(N(R*R+(((RR<vst MythThemecBstZRS(N(R*R+(((RR=xst FILESYSTEMSRtARCHtRUNLEVELRtrunleveltNUM_CPUStVENDORtSYSTEMt CPU_VENDORtKERNEL_VERSIONt FORMFACTORtLANGUAGEtSELINUX_ENABLEDtenabledtSELINUX_ENFORCEtenforcetSELINUX_POLICYtpolicyt TOTALLISTt UNIQUELISTRcCsttitiiƒgƒS(N(R RRR Rtid(((Rt total_hosts½scCstitƒiƒS(N(tsessiontqueryt HardwareClasstall(((Rt all_classesΐscCsJttititiiƒƒgtiitiijƒi ƒi ƒdS(Ni( R RRRR RRQt host_linkst host_link_idtexecutetfetchone(((Rthost_count_with_devicesΔs!c CsOtdtgtiittii|jtiitiijƒdt dt ƒS(NttmpRR( Rtcomputer_logical_devicesRXRRYtand_tclst device_idRQtTrue(R`((Rtdevices_per_classΘscCs%t|ƒiƒidƒiƒiƒS(Nid(RcR`R tlimitRZtfetchall(R`((Rttop_devices_per_classΞscCs_ttititiiƒƒgttii |jtii tii jƒƒi ƒi ƒdS(Ni(R RRRRXRRYR_R^R`RaRQRZR[(R`((Rthosts_per_classάs!cCs|iƒiƒiƒS(N(ttableR RZRe(Rh((Rt just_selectβscCs,tti|iiƒgƒiƒiƒdS(Ni(R RRRhRRQRZR[(Rh((Rt just_countεsc CsAtdgtiitii|jdtdtƒiƒiƒd S(NR]RRid( RR^Rt vendor_idR`RbtFalseRZRe(R`((Rttop_vendors_per_classθs  N(Nt sqlalchemytsqlalchemy.ormthardware.model.modelR R R RRtNoneRlRR R'R(tobjectR)R,R-R.R/R0R1R2R3R4R5R6R7R8R9R:R;R<R=t file_systemsRtfs_typeRQthost_idRbtfilesystplatformtarchstostosestdefault_runlevelt runlevelstnum_cpustvendortvendorstsystemtsystemst cpu_vendort cpu_vendorstkernel_versiontkernel_versionst formfactort formfactorstlanguaget languagestselinux_enabledtselinux_enforcetselinux_policyR^t descriptionRXRat totallistt uniquelistRRRWR\RcRfRgRiRjRm(5R=R4R6R1R‹R7RiRŠRcRvR.RWRR R(R0R R<R}R|R\R‰RRRgRR:R,R/R;R3R9RjR5RŽR'R…RR8R)R‡RR RmRŒR2RzR RƒRRRfR-Rx((Rt?sš      *