pyaci icon indicating copy to clipboard operation
pyaci copied to clipboard

Allow rmetagen.py to be imported and used without arguments

Open Wyko opened this issue 5 years ago • 1 comments

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)

Wyko avatar Jun 28 '19 08:06 Wyko