#NEWLINE# def getOsCredentialsFromEnvironment( ) : #NEWLINE# #INDENT# credentials = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# credentials [ 'VERSION' ] = os . environ [ 'OS_COMPUTE_API_VERSION' ] #NEWLINE# credentials [ 'USERNAME' ] = os . environ [ 'OS_USERNAME' ] #NEWLINE# credentials [ 'PASSWORD' ] = os . environ [ 'OS_PASSWORD' ] #NEWLINE# credentials [ 'TENANT_NAME' ] = os . environ [ 'OS_TENANT_NAME' ] #NEWLINE# credentials [ 'AUTH_URL' ] = os . environ [ 'OS_AUTH_URL' ] #NEWLINE# #UNINDENT# except KeyError as e : #NEWLINE# #INDENT# print ( ( 'ERROR: environment variable %s is not defined' % e ) , file = sys . stderr ) #NEWLINE# sys . exit ( ( - 1 ) ) #NEWLINE# #UNINDENT# return credentials