Closed alex-harvey-z3q closed 7 years ago
Hi @garnaat , is this an easy yes/no question?
@garnaat , Your suggestion in the SO post leads to a failure (as seen in my Jenkins log):
14:21:37 + python /var/lib/jenkins/jobs/Encrypt_AMI/workspace/scripts/aws_ec2_copy_image.py --encrypted --source-image-id ami-52293031 jenkins
14:21:38 Traceback (most recent call last):
14:21:38 File "/var/lib/jenkins/jobs/Encrypt_AMI/workspace/scripts/aws_ec2_copy_image.py", line 208, in <module>
14:21:38 main()
14:21:38 File "/var/lib/jenkins/jobs/Encrypt_AMI/workspace/scripts/aws_ec2_copy_image.py", line 186, in main
14:21:38 pill = placebo.attach(boto3.session, '/tmp')
14:21:38 File "/usr/lib/python2.6/site-packages/placebo/__init__.py", line 20, in attach
14:21:38 pill.attach(session, data_path)
14:21:38 File "/usr/lib/python2.6/site-packages/placebo/pill.py", line 130, in attach
14:21:38 session.events.register('creating-client-class', self._create_client)
14:21:38 AttributeError: 'module' object has no attribute 'events'
If you have any high-level suggestions on how to fix, I'm more than happy to do implementation and testing of the feature/change.
I hope it's OK to ask a question here. I can't find this explained in the docs.
I have legacy code that does a lot of stuff using the default Boto3 session, e.g.
However, docs here at this project seem to imply that I need to manage the session explicity, i.e.
Then you need to attach Placebo to
session
.But is it possible to attach Placebo somehow to the default session -- or would I have to refactor all my legacy code before I could use Placebo on it?
Thanks,