mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 12:03:58 -07:00
Fix undefined variables, basestring usage, and some associated python3 issues
This commit is contained in:
parent
9f7b0dfc30
commit
225fa5d092
84 changed files with 652 additions and 963 deletions
|
@ -49,14 +49,16 @@ This script has been inspired by the cobbler.py inventory. thanks
|
|||
Author: Damien Garros (@dgarros)
|
||||
Version: 0.2.0
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
|
||||
try:
|
||||
import json
|
||||
import argparse
|
||||
HAS_ARGPARSE = True
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
HAS_ARGPARSE = False
|
||||
|
||||
try:
|
||||
from apstra.aosom.session import Session
|
||||
|
@ -292,6 +294,8 @@ class AosInventory(object):
|
|||
|
||||
if not HAS_AOS_PYEZ:
|
||||
raise Exception('aos-pyez is not installed. Please see details here: https://github.com/Apstra/aos-pyez')
|
||||
if not HAS_ARGPARSE:
|
||||
raise Exception('argparse is not installed. Please install the argparse library or upgrade to python-2.7')
|
||||
|
||||
# Initialize inventory
|
||||
self.inventory = dict() # A list of groups and the hosts in that group
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue