I'm working on an open source script, for AWS snapshots using the boto3 python sdk.
I have a function that returns json, which contains a function:
datetime.datetime(2017, 11, 3, 21, 2, 27, tzinfo=tzlocal())
When I store the results from the json, it stores that function string, rather than the result of that function.
How can I get python3 to execute that function?
(oddly enough when I print that dict time, it shows correct)
This is what my dict looks like:
{'snap-05c84': datetime.datetime(2017, 11, 3, 22, 4, 48, tzinfo=tzlocal()), 'snap-08bcb': datetime.datetime(2017, 11, 3, 21, 2, 27, tzinfo=tzlocal())}
And the code that builds the dict is:
for snap in snaps['Snapshots']:
snap_id=snap['SnapshotId']
start_time=snap['StartTime']
snap_times[snap_id]=start_time
Thanks in advance!!!