bluethundr12

Untitled

Jun 4th, 2019
111
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ### error
  2.  
  3. Traceback (most recent call last):
  4. File ".\aws_ec2_list_instances.py", line 416, in <module>
  5. main()
  6. File ".\aws_ec2_list_instances.py", line 380, in main
  7. get_page_info(auth, pageid)
  8. File ".\aws_ec2_list_instances.py", line 254, in get_page_info
  9. r = requests.get(url, auth = auth)
  10. File "C:\Users\tdunphy\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\api.py", line 75, in get
  11. return request('get', url, params=params, **kwargs)
  12. File "C:\Users\tdunphy\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\api.py", line 60, in request
  13. return session.request(method=method, url=url, **kwargs)
  14. File "C:\Users\tdunphy\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 519, in request
  15. prep = self.prepare_request(req)
  16. File "C:\Users\tdunphy\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 462, in prepare_request
  17. hooks=merge_hooks(request.hooks, self.hooks),
  18. File "C:\Users\tdunphy\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\models.py", line 317, in prepare
  19. self.prepare_auth(auth, url)
  20. File "C:\Users\tdunphy\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\models.py", line 548, in prepare_auth
  21. r = auth(self)
  22. TypeError: 'str' object is not callable
  23.  
  24. ### Code
  25. def get_page_info(auth, pageid):
  26. url = '{base}/{pageid}'.format(
  27. base = BASE_URL,
  28. pageid = pageid)
  29. r = requests.get(url, auth = auth)
  30. r.raise_for_status()
  31. return r.json()
RAW Paste Data