Skip to content

Commit cca7a59

Browse files
authored
fix transfer sample
1 parent a18bd3b commit cca7a59

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

transfer-ftp-s3/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ logs:
2929
@localstack logs > logs.txt
3030

3131
test-ci:
32-
make start install ready run; return_code=`echo $$?`;\
32+
make install start ready run; return_code=`echo $$?`;\
3333
make logs; make stop; exit $$return_code;
3434

3535
.PHONY: usage install start run stop ready logs test-ci

transfer-ftp-s3/test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import io
22
import time
3-
import uuid
43
import boto3
5-
from ftplib import FTP, FTP_TLS
4+
from ftplib import FTP
5+
import re
66

77
EDGE_URL = 'http://localhost:4566'
88

@@ -29,7 +29,8 @@ def create_transfer_api():
2929
time.sleep(1)
3030

3131
server_id = rs['ServerId']
32-
port = int(server_id.split(':')[1])
32+
match = re.match(r"^s-[a-z]*([0-9]{4,5})$", server_id)
33+
port = int(match.group(1))
3334

3435
s3_client.create_bucket(Bucket=BUCKET)
3536

0 commit comments

Comments
 (0)