Toggle navigation
Toggle navigation
This project
Loading...
Sign in
서승완
/
kappa
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Mitch Garnaat
2015-12-08 11:55:03 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
549884b5706bd50b643efc33747b074da10821cf
549884b5
1 parent
975a3659
Fixing some ugly code.
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
kappa/awsclient.py
kappa/function.py
kappa/awsclient.py
View file @
549884b
...
...
@@ -29,7 +29,7 @@ class AWSClient(object):
self
.
_service_name
=
service_name
self
.
_region_name
=
region_name
self
.
_profile_name
=
profile_name
self
.
_
client
=
self
.
_create_client
()
self
.
client
=
self
.
_create_client
()
@property
def
service_name
(
self
):
...
...
@@ -80,12 +80,12 @@ class AWSClient(object):
LOG
.
debug
(
kwargs
)
if
query
:
query
=
jmespath
.
compile
(
query
)
if
self
.
_
client
.
can_paginate
(
op_name
):
paginator
=
self
.
_
client
.
get_paginator
(
op_name
)
if
self
.
client
.
can_paginate
(
op_name
):
paginator
=
self
.
client
.
get_paginator
(
op_name
)
results
=
paginator
.
paginate
(
**
kwargs
)
data
=
results
.
build_full_result
()
else
:
op
=
getattr
(
self
.
_
client
,
op_name
)
op
=
getattr
(
self
.
client
,
op_name
)
data
=
op
(
**
kwargs
)
if
query
:
data
=
query
.
search
(
data
)
...
...
@@ -99,7 +99,7 @@ def save_recordings(recording_path):
for
key
in
_client_cache
:
client
=
_client_cache
[
key
]
full_path
=
os
.
path
.
join
(
recording_path
,
'{}.json'
.
format
(
key
))
client
.
_
client
.
meta
.
placebo
.
save
(
full_path
)
client
.
client
.
meta
.
placebo
.
save
(
full_path
)
def
create_client
(
service_name
,
context
):
...
...
@@ -116,9 +116,9 @@ def create_client(service_name, context):
placebo_cfg
[
'recording_path'
],
'{}.json'
.
format
(
client_key
))
if
os
.
path
.
exists
(
full_path
):
client
.
_
client
.
meta
.
placebo
.
load
(
full_path
)
client
.
_
client
.
meta
.
placebo
.
start
()
client
.
client
.
meta
.
placebo
.
load
(
full_path
)
client
.
client
.
meta
.
placebo
.
start
()
elif
placebo_cfg
[
'mode'
]
==
'record'
:
client
.
_
client
.
meta
.
placebo
.
record
()
client
.
client
.
meta
.
placebo
.
record
()
_client_cache
[
client_key
]
=
client
return
_client_cache
[
client_key
]
...
...
kappa/function.py
View file @
549884b
...
...
@@ -315,14 +315,14 @@ class Function(object):
# First find the SHA256 of $LATEST
if
not
version
:
versions
=
self
.
list_versions
()
for
v
ersion
in
versions
:
if
v
ersion
[
'Version'
]
==
'$LATEST'
:
latest_sha256
=
v
ersion
[
'CodeSha256'
]
for
v
in
versions
:
if
v
[
'Version'
]
==
'$LATEST'
:
latest_sha256
=
v
[
'CodeSha256'
]
break
for
v
ersion
in
versions
:
if
v
ersion
[
'Version'
]
!=
'$LATEST'
:
if
v
ersion
[
'CodeSha256'
]
==
latest_sha256
:
version
=
v
ersion
[
'Version'
]
for
v
in
versions
:
if
v
[
'Version'
]
!=
'$LATEST'
:
if
v
[
'CodeSha256'
]
==
latest_sha256
:
version
=
v
[
'Version'
]
break
try
:
LOG
.
info
(
'creating alias
%
s=
%
s'
,
name
,
version
)
...
...
Please
register
or
login
to post a comment