linting fixes

This commit is contained in:
Fabio Dias 2019-12-15 20:11:38 -05:00
parent bc615797b1
commit fb9ebe5a47
8 changed files with 24 additions and 22 deletions

View File

@ -42,11 +42,10 @@ from .utils import make_function_arn, make_function_ver_arn
from moto.sqs import sqs_backends
from moto.dynamodb2 import dynamodb_backends2
from moto.dynamodbstreams import dynamodbstreams_backends
from moto.iam.models import ACCOUNT_ID
logger = logging.getLogger(__name__)
from moto.iam.models import ACCOUNT_ID
try:
from tempfile import TemporaryDirectory

View File

@ -1056,7 +1056,7 @@ DESCRIBE_STACKSET_OPERATION_RESPONSE_TEMPLATE = """<DescribeStackSetOperationRes
<DescribeStackSetOperationResult>
<StackSetOperation>
<ExecutionRoleName>{{ stackset.execution_role }}</ExecutionRoleName>
<AdministrationRoleARN>arn:aws:iam::"""+ACCOUNT_ID+""":role/{{ stackset.admin_role }}</AdministrationRoleARN>
<AdministrationRoleARN>arn:aws:iam::""" + ACCOUNT_ID + """:role/{{ stackset.admin_role }}</AdministrationRoleARN>
<StackSetId>{{ stackset.id }}</StackSetId>
<CreationTimestamp>{{ operation.CreationTimestamp }}</CreationTimestamp>
<OperationId>{{ operation.OperationId }}</OperationId>
@ -1081,7 +1081,7 @@ LIST_STACK_SET_OPERATION_RESULTS_RESPONSE_TEMPLATE = """<ListStackSetOperationRe
{% for account, region in instance.items() %}
<member>
<AccountGateResult>
<StatusReason>Function not found: arn:aws:lambda:us-west-2:"""+ACCOUNT_ID+""":function:AWSCloudFormationStackSetAccountGate</StatusReason>
<StatusReason>Function not found: arn:aws:lambda:us-west-2:""" + ACCOUNT_ID + """:function:AWSCloudFormationStackSetAccountGate</StatusReason>
<Status>SKIPPED</Status>
</AccountGateResult>
<Region>{{ region }}</Region>

View File

@ -249,7 +249,7 @@ class InstanceResponse(BaseResponse):
EC2_RUN_INSTANCES = """<RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2013-10-15/">
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
<reservationId>{{ reservation.id }}</reservationId>
<ownerId>"""+ACCOUNT_ID+"""</ownerId>
<ownerId>""" + ACCOUNT_ID + """</ownerId>
<groupSet>
<item>
<groupId>sg-245f6a01</groupId>
@ -331,7 +331,7 @@ EC2_RUN_INSTANCES = """<RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc
<vpcId>{{ nic.subnet.vpc_id }}</vpcId>
{% endif %}
<description>Primary network interface</description>
<ownerId>"""+ACCOUNT_ID+"""</ownerId>
<ownerId>""" + ACCOUNT_ID + """</ownerId>
<status>in-use</status>
<macAddress>1b:2b:3c:4d:5e:6f</macAddress>
<privateIpAddress>{{ nic.private_ip_address }}</privateIpAddress>
@ -354,7 +354,7 @@ EC2_RUN_INSTANCES = """<RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc
{% if nic.public_ip %}
<association>
<publicIp>{{ nic.public_ip }}</publicIp>
<ipOwnerId>"""+ACCOUNT_ID+"""</ipOwnerId>
<ipOwnerId>""" + ACCOUNT_ID + """</ipOwnerId>
</association>
{% endif %}
<privateIpAddressesSet>
@ -364,7 +364,7 @@ EC2_RUN_INSTANCES = """<RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc
{% if nic.public_ip %}
<association>
<publicIp>{{ nic.public_ip }}</publicIp>
<ipOwnerId>"""+ACCOUNT_ID+"""</ipOwnerId>
<ipOwnerId>""" + ACCOUNT_ID + """</ipOwnerId>
</association>
{% endif %}
</item>
@ -383,7 +383,7 @@ EC2_DESCRIBE_INSTANCES = """<DescribeInstancesResponse xmlns="http://ec2.amazona
{% for reservation in reservations %}
<item>
<reservationId>{{ reservation.id }}</reservationId>
<ownerId>"""+ACCOUNT_ID+"""</ownerId>
<ownerId>""" + ACCOUNT_ID + """</ownerId>
<groupSet>
{% for group in reservation.dynamic_group_list %}
<item>
@ -476,7 +476,7 @@ EC2_DESCRIBE_INSTANCES = """<DescribeInstancesResponse xmlns="http://ec2.amazona
{% endfor %}
</blockDeviceMapping>
<virtualizationType>{{ instance.virtualization_type }}</virtualizationType>
<clientToken>ABCDE"""+ACCOUNT_ID+"""3</clientToken>
<clientToken>ABCDE""" + ACCOUNT_ID + """3</clientToken>
{% if instance.get_tags() %}
<tagSet>
{% for tag in instance.get_tags() %}
@ -499,7 +499,7 @@ EC2_DESCRIBE_INSTANCES = """<DescribeInstancesResponse xmlns="http://ec2.amazona
<vpcId>{{ nic.subnet.vpc_id }}</vpcId>
{% endif %}
<description>Primary network interface</description>
<ownerId>"""+ACCOUNT_ID+"""</ownerId>
<ownerId>""" + ACCOUNT_ID + """</ownerId>
<status>in-use</status>
<macAddress>1b:2b:3c:4d:5e:6f</macAddress>
<privateIpAddress>{{ nic.private_ip_address }}</privateIpAddress>
@ -526,7 +526,7 @@ EC2_DESCRIBE_INSTANCES = """<DescribeInstancesResponse xmlns="http://ec2.amazona
{% if nic.public_ip %}
<association>
<publicIp>{{ nic.public_ip }}</publicIp>
<ipOwnerId>"""+ACCOUNT_ID+"""</ipOwnerId>
<ipOwnerId>""" + ACCOUNT_ID + """</ipOwnerId>
</association>
{% endif %}
<privateIpAddressesSet>
@ -536,7 +536,7 @@ EC2_DESCRIBE_INSTANCES = """<DescribeInstancesResponse xmlns="http://ec2.amazona
{% if nic.public_ip %}
<association>
<publicIp>{{ nic.public_ip }}</publicIp>
<ipOwnerId>"""+ACCOUNT_ID+"""</ipOwnerId>
<ipOwnerId>""" + ACCOUNT_ID + """</ipOwnerId>
</association>
{% endif %}
</item>

View File

@ -177,7 +177,7 @@ DESCRIBE_SECURITY_GROUPS_RESPONSE = """<DescribeSecurityGroupsResponse xmlns="ht
<securityGroupInfo>
{% for group in groups %}
<item>
<ownerId>"""+ACCOUNT_ID+"""</ownerId>
<ownerId>""" + ACCOUNT_ID + """</ownerId>
<groupId>{{ group.id }}</groupId>
<groupName>{{ group.name }}</groupName>
<groupDescription>{{ group.description }}</groupDescription>
@ -197,7 +197,7 @@ DESCRIBE_SECURITY_GROUPS_RESPONSE = """<DescribeSecurityGroupsResponse xmlns="ht
<groups>
{% for source_group in rule.source_groups %}
<item>
<userId>"""+ACCOUNT_ID+"""</userId>
<userId>""" + ACCOUNT_ID + """</userId>
<groupId>{{ source_group.id }}</groupId>
<groupName>{{ source_group.name }}</groupName>
</item>
@ -226,7 +226,7 @@ DESCRIBE_SECURITY_GROUPS_RESPONSE = """<DescribeSecurityGroupsResponse xmlns="ht
<groups>
{% for source_group in rule.source_groups %}
<item>
<userId>"""+ACCOUNT_ID+"""</userId>
<userId>""" + ACCOUNT_ID + """</userId>
<groupId>{{ source_group.id }}</groupId>
<groupName>{{ source_group.name }}</groupName>
</item>

View File

@ -2,6 +2,7 @@ from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.iam.models import ACCOUNT_ID
class VPCPeeringConnections(BaseResponse):
def create_vpc_peering_connection(self):
peer_region = self._get_param("PeerRegion")
@ -56,7 +57,7 @@ CREATE_VPC_PEERING_CONNECTION_RESPONSE = """
</peeringOptions>
</requesterVpcInfo>
<accepterVpcInfo>
<ownerId>"""+ACCOUNT_ID+"""</ownerId>
<ownerId>""" + ACCOUNT_ID + """</ownerId>
<vpcId>{{ vpc_pcx.peer_vpc.id }}</vpcId>
</accepterVpcInfo>
<status>
@ -82,7 +83,7 @@ DESCRIBE_VPC_PEERING_CONNECTIONS_RESPONSE = """
<cidrBlock>{{ vpc_pcx.vpc.cidr_block }}</cidrBlock>
</requesterVpcInfo>
<accepterVpcInfo>
<ownerId>"""+ACCOUNT_ID+"""</ownerId>
<ownerId>""" + ACCOUNT_ID + """</ownerId>
<vpcId>{{ vpc_pcx.peer_vpc.id }}</vpcId>
<cidrBlock>{{ vpc_pcx.peer_vpc.cidr_block }}</cidrBlock>
<peeringOptions>
@ -120,7 +121,7 @@ ACCEPT_VPC_PEERING_CONNECTION_RESPONSE = """
<cidrBlock>{{ vpc_pcx.vpc.cidr_block }}</cidrBlock>
</requesterVpcInfo>
<accepterVpcInfo>
<ownerId>"""+ACCOUNT_ID+"""</ownerId>
<ownerId>""" + ACCOUNT_ID + """</ownerId>
<vpcId>{{ vpc_pcx.peer_vpc.id }}</vpcId>
<cidrBlock>{{ vpc_pcx.peer_vpc.cidr_block }}</cidrBlock>
<peeringOptions>

View File

@ -45,7 +45,7 @@ from .utils import (
random_policy_id,
)
ACCOUNT_ID = '123456789012' #make sure this is a str and not an int
ACCOUNT_ID = '123456789012'
class MFADevice(object):

View File

@ -2,8 +2,10 @@ from __future__ import unicode_literals
import random
import string
from moto.iam.models import ACCOUNT_ID
from moto.iam.models import ACCOUNT_ID as MASTER_ACCOUNT_ID
MASTER_ACCOUNT_ID = ACCOUNT_ID
MASTER_ACCOUNT_EMAIL = "master@example.com"
DEFAULT_POLICY_ID = "p-FullAWSAccess"
ORGANIZATION_ARN_FORMAT = "arn:aws:organizations::{0}:organization/{1}"

View File

@ -1899,7 +1899,7 @@ S3_ALL_MULTIPARTS = """<?xml version="1.0" encoding="UTF-8"?>
<Key>{{ upload.key_name }}</Key>
<UploadId>{{ upload.id }}</UploadId>
<Initiator>
<ID>arn:aws:iam::"""+ACCOUNT_ID+""":user/user1-11111a31-17b5-4fb7-9df5-b111111f13de</ID>
<ID>arn:aws:iam::""" + ACCOUNT_ID + """:user/user1-11111a31-17b5-4fb7-9df5-b111111f13de</ID>
<DisplayName>user1-11111a31-17b5-4fb7-9df5-b111111f13de</DisplayName>
</Initiator>
<Owner>