Best Python code snippet using localstack_python
afitools.py
Source:afitools.py
...53 """ share the AFI in Region region with users in userlist. """54 client = boto3.client('ec2', region_name=region)55 if "public" in useridlist:56 rootLogger.info("Sharing AGFI publicly.")57 result = client.modify_fpga_image_attribute(58 FpgaImageId=afi_id,59 Attribute='loadPermission',60 OperationType='add',61 UserGroups=['all']62 )63 else:64 rootLogger.info("Sharing AGFI with selected users.")65 result = client.modify_fpga_image_attribute(66 FpgaImageId=afi_id,67 Attribute='loadPermission',68 OperationType='add',69 UserIds=useridlist70 )71 rootLogger.debug(result)72def get_afi_sharing_ids_from_conf(conf):73 usersdict = conf.ini['agfisharing']74 return usersdict.values()75def share_agfi_in_all_regions(agfi_id, useridlist):76 """ For the given AGFI, for each fpga region, get the AFI, then share77 with the users in useridlist """78 all_fpga_regions = get_fpga_regions()79 for region in all_fpga_regions:...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!