pyaci
pyaci copied to clipboard
Allow rmetagen.py to be imported and used without arguments
I may be missing something obvious in how to import this module, but it seems like it is designed to only work from the command line. I would like to import it into my application to automate the generation of the meta. Something like this:
from Scripts import rmetagen
# If an existing session wasn't supplied, make a new session
if not isinstance(apic, Node):
try:
apic = Node(config['ACI APIC']['url'])
except MetaError:
# This implies that the meta hasn't been downloaded yet
rmetagen.generateMeta(host, username, password)