3 %Tf @sfddlmZddlmZddlmZddlmZdgZdZddZdd dZ d d Z e d krbe d S)) rhnserver) up2dateAuth)pkgUtils)packagesupdatecCstj}|jjtj|S)N)rZ RhnServerZerrataZ getErrataInforZ getSystemId)Z errata_idsr /usr/lib/python3.6/errata.py__getErrataInfosr Nc Csg}t|tgtfgkr"|g}x|D]}t|}||}q(Wi}i}x4tjddD]$}|||d|d<|||d<qVWi}t|ddkrx|D]|}d|d|df|kr|||d|d<qd|d|kr|||d|d<q|dd kr|d|kr|||d<qWn*x(|D] }|d|kr"|||d<q"Wt|j}|gkri} d | d <d | d<|| d <dd| fStj||S)N)ZgetArchnameZarchrz%s%sz%snoarchZnoarch0versionzerrata.update.no_packagesZerratas'z*No packages from that errata are available) typer rZgetInstalledPackageListlenlistvaluesrr) Z errataidlistZ cache_onlyZ packagelistZerrataidZtmpListZcurrent_packages_with_archZcurrent_packagespudatar r r rsB      cCsttdgdS)Niie)printrr r r r mainPsr__main__)N) Zup2date_clientrrrZ rhn.actionsrZ __rhnexport__ZACTION_VERSIONr rr__name__r r r r  s     7