def get_credentials(module):
 if (not HAS_LIBCLOUD):
  module.fail_json(msg='libcloud is required for this module.')
  return None
 user_id = None
 key = None
 if ('mcp_user' in module.params):
  if ('mcp_password' not in module.params):
   module.fail_json(('"mcp_user" parameter was specified, but not "mcp_password" ' + '(either both must be specified, or neither).'))
   return None
  user_id = module.params['mcp_user']
  key = module.params['mcp_password']
 if ((not user_id) or (not key)):
  user_id = os.environ.get('MCP_USER', None)
  key = os.environ.get('MCP_PASSWORD', None)
 if ((not user_id) or (not key)):
  home = expanduser('~')
  config = ConfigParser.RawConfigParser()
  config.read(('%s/.dimensiondata' % home))
  try:
   user_id = config.get('dimensiondatacloud', 'MCP_USER')
   key = config.get('dimensiondatacloud', 'MCP_PASSWORD')
  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
   pass
 if (not user_id):
  raise MissingCredentialsError('Dimension Data user id not found')
 elif (not key):
  raise MissingCredentialsError('Dimension Data key not found')
 return dict(user_id=user_id, key=key)

def get_credentials ( module ) : if ( not HAS_LIBCLOUD ) : module . fail_json ( msg = 'libcloud is required for this module.' ) return None user_id = None key = None if ( 'mcp_user' in module . params ) : if ( 'mcp_password' not in module . params ) : module . fail_json ( ( '"mcp_user" parameter was specified, but not "mcp_password" ' + '(either both must be specified, or neither).' ) ) return None user_id = module . params [ 'mcp_user' ] key = module . params [ 'mcp_password' ] if ( ( not user_id ) or ( not key ) ) : user_id = os . environ . get ( 'MCP_USER' , None ) key = os . environ . get ( 'MCP_PASSWORD' , None ) if ( ( not user_id ) or ( not key ) ) : home = expanduser ( '~' ) config = ConfigParser . RawConfigParser ( ) config . read ( ( '%s/.dimensiondata' % home ) ) try : user_id = config . get ( 'dimensiondatacloud' , 'MCP_USER' ) key = config . get ( 'dimensiondatacloud' , 'MCP_PASSWORD' ) except ( ConfigParser . NoSectionError , ConfigParser . NoOptionError ) : pass if ( not user_id ) : raise MissingCredentialsError ( 'Dimension Data user id not found' ) elif ( not key ) : raise MissingCredentialsError ( 'Dimension Data key not found' ) return dict ( user_id = user_id , key = key )
get consul api password from security .