Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate socless_template_string #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions functions/cache_results/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License
from typing import Any
from socless import socless_bootstrap, socless_template_string
from socless import socless_bootstrap


def handle_state(execution_context, entries: Any):
Expand All @@ -28,13 +28,11 @@ def handle_state(execution_context, entries: Any):
A dictionary that contains the thing you want to be cached.
{"cached": data}
"""
if isinstance(entries, str):
entries = socless_template_string(entries, execution_context)
elif isinstance(entries, dict):
if isinstance(entries, dict):
new_entries = {}
for key, value in list(entries.items()):
if isinstance(value, str):
new_entries[key] = socless_template_string(value, execution_context)
new_entries[key] = value
else:
new_entries[key] = value
entries = new_entries
Expand Down
6 changes: 3 additions & 3 deletions functions/socless_log_findings/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
from socless import socless_bootstrap, gen_id, save_to_s3, socless_template_string
from socless import socless_bootstrap, gen_id, save_to_s3
from datetime import datetime
import urllib.parse
import os
Expand Down Expand Up @@ -76,10 +76,10 @@ def handle_state(
}

try:
findings = socless_template_string(urllib.parse.unquote(findings), context)
findings = urllib.parse.unquote(findings)
except Exception as e:
print(
f"unable to parse socless_template_string. Error: {e}. Findings: {findings}"
f"unable to parse findings. Error: {e}. Findings: {findings}"
)
raise

Expand Down