<s> """<STR_LIT>""" <EOL> from Bcfg2 . Server . Lint import ServerPlugin <EOL> class Bundler ( ServerPlugin ) : <EOL> """<STR_LIT>""" <EOL> __serverplugin__ = '<STR_LIT>' <EOL> def Run ( self ) : <EOL> self . missing_bundles ( ) <EOL> for bundle in self . core . plugins [ '<STR_LIT>' ] . entries . values ( ) : <EOL> if self . HandlesFile ( bundle . name ) : <EOL> self . bundle_names ( bundle ) <EOL> @ classmethod <EOL> def Errors ( cls ) : <EOL> return { "<STR_LIT>" : "<STR_LIT:error>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT:error>" , <EOL> "<STR_LIT>" : "<STR_LIT:error>" } <EOL> def missing_bundles ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . files is None : <EOL> groupdata = self . metadata . groups_xml . xdata <EOL> ref_bundles = set ( [ b . get ( "<STR_LIT:name>" ) <EOL> for b in groupdata . findall ( "<STR_LIT>" ) ] ) <EOL> allbundles = self . core . plugins [ '<STR_LIT>' ] . bundles . keys ( ) <EOL> for bundle in ref_bundles : <EOL> if bundle not in allbundles : <EOL> self . LintError ( "<STR_LIT>" , <EOL> "<STR_LIT>" % <EOL> bundle ) <EOL> for bundle in allbundles : <EOL> if bundle not in ref_bundles : <EOL> self . LintError ( "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" % bundle ) <EOL> def bundle_names ( self , bundle ) : <EOL> """<STR_LIT>""" <EOL> if bundle . xdata . get ( '<STR_LIT:name>' ) : <EOL> self . LintError ( "<STR_LIT>" , <EOL> "<STR_LIT>" % <EOL> bundle . name ) <EOL> if bundle . name . endswith ( "<STR_LIT>" ) : <EOL> self . LintError ( "<STR_LIT>" , <EOL> "<STR_LIT>" % <EOL> bundle . name ) </s>
