Trees | Indices | Help |
|
---|
|
1 ########################################################################### 2 # 3 # This program is part of Zenoss Core, an open source monitoring platform. 4 # Copyright (C) 2007, Zenoss Inc. 5 # 6 # This program is free software; you can redistribute it and/or modify it 7 # under the terms of the GNU General Public License version 2 as published by 8 # the Free Software Foundation. 9 # 10 # For complete information please visit: http://www.zenoss.com/oss/ 11 # 12 ########################################################################### 13 import os 14 import transaction 15 import Globals 16 17 from Products.ZenRelations.ImportRM import ImportRM 182033 34 35 if __name__ == "__main__": 36 rl = XmlDataLoader() 37 rl.loadDatabase() 3822 datadir = os.path.join(os.path.dirname(__file__),"data") 23 self.log.info("loading data from:%s", datadir) 24 for path, dirname, filenames in os.walk(datadir): 25 for filename in filter(lambda f: f.endswith(".xml"), filenames): 26 self.options.infile = os.path.join(path,filename) 27 self.log.info("loading: %s", self.options.infile) 28 ImportRM.loadDatabase(self) 29 # Reindex ProductKeys and EventClassKeys after XML load 30 self.dmd.Manufacturers.reIndex() 31 self.dmd.Events.reIndex() 32 transaction.commit()
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Thu Oct 25 16:28:22 2007 | http://epydoc.sourceforge.net |