Package ZenModel :: Module zenmib :: Class zenmib
[hide private]
[frames] | no frames]

Class zenmib

source code

Products.ZenUtils.ZCmdBase.ZCmdBase --+
                                      |
                                     zenmib

Wrapper around the smidump utilities to load MIB files into the DMD tree.

Instance Methods [hide private]
tuple of ( name, dependency object)
map_file_to_dependents(self, mibfile)
Scan the MIB file to determine what MIB trees the file is dependent on.
source code
DependencyMap
dependencies(self, filenames)
Create a dependency map for all MIB files.
source code
list of strings
getDependencies(self, filename, depMap)
smidump needs to know the list of dependent files for a MIB file in order to properly resolve external references.
source code
MIB object
generate_python_from_mib(self, mibname, dependencies)
Use the smidump program to convert a MIB into Python code"
source code
boolean
load_mib(self, mibs, mibname, depmap)
Attempt to load a MIB after generating its dependency tree
source code
 
main(self)
Main loop of the program
source code
 
buildOptions(self)
Command-line options
source code
Class Variables [hide private]
  MIB_MOD_ATTS = 'language', 'contact', 'description'
Method Details [hide private]

map_file_to_dependents(self, mibfile)

source code 
Scan the MIB file to determine what MIB trees the file is dependent on.
Parameters:
  • mibfile (string) - MIB filename
Returns: tuple of ( name, dependency object)
dependency tree

dependencies(self, filenames)

source code 
Create a dependency map for all MIB files. Exit the program if we're missing any files.
Parameters:
  • filenames (list of strings) - names of MIB files to import
Returns: DependencyMap
dependency tree

getDependencies(self, filename, depMap)

source code 
smidump needs to know the list of dependent files for a MIB file in order to properly resolve external references.
Parameters:
  • filename (string) - name of MIB file to import
  • depMap (DependencyMap) - dependency tree
Returns: list of strings
list of dependencies

generate_python_from_mib(self, mibname, dependencies)

source code 
Use the smidump program to convert a MIB into Python code"
Parameters:
  • mibname (string) - name of the MIB
  • dependencies (list of strings) - list of dependent files
Returns: MIB object
the newly created MIB

load_mib(self, mibs, mibname, depmap)

source code 
Attempt to load a MIB after generating its dependency tree
Parameters:
  • mibs (list of strings) - filenames of the MIBs to load
  • mibname (string) - name of the MIB
  • dependencies (string) - list of dependent files
Returns: boolean
whether the MIB load was successful or not