Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1657c6a

Browse files
committed
fix missing imports in UI code
1 parent 04cf8de commit 1657c6a

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.pyc
22
*.class
3+
*.log
34
/infra/
45
/node_modules/
56
/nosetests.xml

‎localstack/dashboard/infra.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import re
44
import sh
55
import json
6+
import logging
67
import base64
78

89
AWS_CACHE_TIMEOUT = 60 * 60 # TODO fix
@@ -12,6 +13,9 @@
1213
TMP_DOWNLOAD_CACHE_MAX_AGE = 30 * 60
1314
last_cache_cleanup_time = {'time': 0}
1415

16+
# logger
17+
LOG = logging.getLogger(__name__)
18+
1519

1620
def get_kinesis_streams(filter='.*', pool={}):
1721
if MOCK_OBJ:
@@ -50,7 +54,7 @@ def get_kinesis_shards(stream_name=None, stream_details=None):
5054
def resolve_string_or_variable(string, code_map):
5155
if re.match(r'^["\'].*["\']$', string):
5256
return string.replace('"', '').replace("'", '')
53-
log("WARNING: Variable resolution not implemented")
57+
LOG.warning("Variable resolution not implemented")
5458
return None
5559

5660

@@ -120,7 +124,7 @@ def handle(func):
120124
code_map = get_lambda_code(func_name)
121125
f.targets = extract_endpoints(code_map, pool)
122126
except Exception, e:
123-
log("WARN: Unable to get code for lambda '%s'" % func_name)
127+
LOG.warning("Unable to get code for lambda '%s'" % func_name)
124128
parallelize(handle, out['Functions'])
125129
# print result
126130
return result
@@ -363,10 +367,10 @@ def get_graph(name_filter='.*'):
363367
lookup_id = s.id
364368
if isinstance(s, DynamoDBStream):
365369
lookup_id = s.table.id
366-
result['edges'].append({'source': node_ids[lookup_id], 'target': uid})
370+
result['edges'].append({'source': node_ids.get(lookup_id), 'target': uid})
367371
for t in l.targets:
368372
lookup_id = t.id
369-
result['edges'].append({'source': uid, 'target': node_ids[lookup_id]})
373+
result['edges'].append({'source': uid, 'target': node_ids.get(lookup_id)})
370374
for b in buckets:
371375
for n in b.notifications:
372376
src_uid = node_ids[b.id]

‎localstack/dashboard/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"angular-resource": "1.3.12",
1414
"angular-sanitize": "1.3.12",
1515
"showdown": "0.3.1",
16-
"@atlassian/aui": "5.9.19",
16+
"@atlassian/aui": "6.0.1",
1717
"angular-aui": "whummer/angular-aui#feat/aui-toggle",
1818
"jsplumb": "2.1.4",
1919
"dagre": "0.7.4",

‎localstack/utils/common.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import time
77
import glob
88
import requests
9+
import sh
910
from datetime import datetime
1011
from multiprocessing.dummy import Pool
1112
from localstack.constants import *
@@ -224,6 +225,14 @@ def do_run(cmd):
224225
return result
225226

226227

228+
def remove_non_ascii(text):
229+
# text = unicode(text, "utf-8")
230+
text = text.decode('utf-8', CODEC_HANDLER_UNDERSCORE)
231+
# text = unicodedata.normalize('NFKD', text)
232+
text = text.encode('ascii', CODEC_HANDLER_UNDERSCORE)
233+
return text
234+
235+
227236
def make_http_request(url, data=None, headers=None, method='GET'):
228237
if is_string(method):
229238
method = requests.__dict__[method.lower()]

0 commit comments

Comments
 (0)