Skip to content

Instantly share code, notes, and snippets.

@ryandotclair
Last active October 31, 2015 05:49
Show Gist options
  • Save ryandotclair/73912c260da5f19c9626 to your computer and use it in GitHub Desktop.
Save ryandotclair/73912c260da5f19c9626 to your computer and use it in GitHub Desktop.
# Get the URL from environmentals. Example: "10.241.209.162:8443"
try:
location = os.environ['SRUNILOCATION']
except KeyError:
logger.critical('Need an IP:Port. Please set the environment variable SRUNILOCATION to IP:Port of Unisphere '
'using either "export SRUNILOCATION=IP:PORT" (linux command) or "set SRUINLOCATION=IP:PORT" '
'(Windows command)')
sys.exit(1)
# Get credentials for Unisphere login from environmentals
try:
user = os.environ['SRUSER']
except KeyError:
logger.critical('Need a username. Please set the environment variable SRUSER to the username of Unisphere using'
'either "export SRUSER=username" (linux command) or "set SRUSER=username" (Windows command)')
sys.exit(1)
try:
password = os.environ['SRPASS']
except KeyError:
logger.critical('Need a password. Please set the environment variable SRPASS to the password of Unisphere using '
'either "export SRUSER=password" (linux command) or "set SRUSER=password" (Windows command)')
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment