Skip to content

Commit

Permalink
add autosource parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Schätzler committed Oct 8, 2024
1 parent 384e9d1 commit 61abc26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def parse_params(logger):
parser = OptionParser()
parser.add_option("-u", "--user", help="specify user to log in", action="store", dest="user")
parser.add_option("-p", "--password", help="specify password to log in", action="store", dest="password")
parser.add_option("-e", "--authsource", help="specify auth source to authenticate against", action="store", dest="authsource")
parser.add_option("-o", "--port", help="specify inventory port", action="store", dest="port")
parser.add_option("-a", "--atlas", help="path to atlas service endpoint", action="store", dest="atlas")
parser.add_option("-m", "--config", help="Path to the configuration to set properties of the resources kept in "
Expand All @@ -37,6 +38,10 @@ def parse_params(logger):
os.environ['USER'] = options.user
if options.password:
os.environ['PASSWORD'] = options.password
if options.authsource:
os.environ['AUTHSOURCE'] = options.authsource
elif "AUTHSOURCE" not in os.environ:
os.environ['AUTHSOURCE'] = 'Local'
if options.info:
logger.setLevel(logging.INFO)
ConsoleHandler.setLevel(logging.INFO)
Expand Down
2 changes: 1 addition & 1 deletion tools/Vrops.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_token(target):
}
payload = {
"username": os.environ['USER'],
"authSource": "Local",
"authSource": os.environ['AUTHSOURCE'],
"password": os.environ['PASSWORD']
}
disable_warnings(exceptions.InsecureRequestWarning)
Expand Down

0 comments on commit 61abc26

Please sign in to comment.