Replaced print with log.debug.
This commit is contained in:
parent
de01adec57
commit
7b096d690f
@ -1,6 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
@ -15,6 +15,8 @@ from moto.core.exceptions import SignatureDoesNotMatchError, AccessDeniedError,
|
|||||||
from moto.s3.exceptions import BucketAccessDeniedError, S3AccessDeniedError, BucketInvalidTokenError, S3InvalidTokenError, S3InvalidAccessKeyIdError, BucketInvalidAccessKeyIdError
|
from moto.s3.exceptions import BucketAccessDeniedError, S3AccessDeniedError, BucketInvalidTokenError, S3InvalidTokenError, S3InvalidAccessKeyIdError, BucketInvalidAccessKeyIdError
|
||||||
from moto.sts import sts_backend
|
from moto.sts import sts_backend
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def create_access_key(access_key_id, headers):
|
def create_access_key(access_key_id, headers):
|
||||||
if access_key_id.startswith("AKIA") or "X-Amz-Security-Token" not in headers:
|
if access_key_id.startswith("AKIA") or "X-Amz-Security-Token" not in headers:
|
||||||
@ -122,9 +124,8 @@ class CreateAccessKeyFailure(Exception):
|
|||||||
class IAMRequestBase(ABC):
|
class IAMRequestBase(ABC):
|
||||||
|
|
||||||
def __init__(self, method, path, data, headers):
|
def __init__(self, method, path, data, headers):
|
||||||
print("Creating {class_name} with method={method}, path={path}, data={data}, headers={headers}".format(
|
log.debug("Creating {class_name} with method={method}, path={path}, data={data}, headers={headers}".format(
|
||||||
class_name=self.__class__.__name__, method=method, path=path, data=data, headers=headers),
|
class_name=self.__class__.__name__, method=method, path=path, data=data, headers=headers))
|
||||||
file=sys.stderr)
|
|
||||||
self._method = method
|
self._method = method
|
||||||
self._path = path
|
self._path = path
|
||||||
self._data = data
|
self._data = data
|
||||||
@ -314,7 +315,7 @@ class IAMPolicyStatement:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _match(pattern, string):
|
def _match(pattern, string):
|
||||||
pattern = pattern.replace("*", ".*")
|
pattern = pattern.replace("*", ".*")
|
||||||
pattern = f"^{pattern}$"
|
pattern = "^{pattern}$".format(pattern=pattern)
|
||||||
return re.match(pattern, string)
|
return re.match(pattern, string)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user