Mock out instance metadata. Make basic connection with iam roles work. Closes #3.
This commit is contained in:
parent
1cc0e0eac7
commit
9e9e057289
3 changed files with 40 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ import functools
|
|||
import re
|
||||
|
||||
from moto.packages.httpretty import HTTPretty
|
||||
from .responses import metadata_response
|
||||
from .utils import convert_regex_to_flask_path
|
||||
|
||||
|
||||
|
|
@ -30,6 +31,13 @@ class MockAWS(object):
|
|||
body=value,
|
||||
)
|
||||
|
||||
# Mock out localhost instance metadata
|
||||
HTTPretty.register_uri(
|
||||
method=method,
|
||||
uri=re.compile('http://169.254.169.254/latest/meta-data/.*'),
|
||||
body=metadata_response
|
||||
)
|
||||
|
||||
def stop(self):
|
||||
HTTPretty.disable()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue