in scripts/update_auto_launch_config.py [0:0]
def validate_launch_profile(self) -> None:
launch_profiles = list()
launch_profile_ids = list()
launch_profile_options_formatted = list()
paginator = self.nimble_client.get_paginator('list_launch_profiles')
pages = paginator.paginate(
studioId=self.studio,
principalId=self.sso_id
)
for page in pages:
for lp in page['launchProfiles']:
launch_profiles.append(lp)
launch_profile_ids.append(lp['launchProfileId'])
launch_profile_options_formatted.append(f"{lp['name']} -> {lp['launchProfileId']}")
if len(launch_profile_ids) < 1:
raise Exception(f"User {self.sso_id} does not have access to any launch profiles")
if self.launch_profile == None or not (self.launch_profile in launch_profile_ids):
self.launch_profile = Prompter.prompt_for_input_from_options("Please select a launch profile", launch_profile_options_formatted, launch_profile_ids)
streaming_image_ids = launch_profiles[launch_profile_ids.index(self.launch_profile)]['streamConfiguration']['streamingImageIds']
self.validate_streaming_images(streaming_image_ids)
ec2_instance_types = launch_profiles[launch_profile_ids.index(self.launch_profile)]['streamConfiguration']['ec2InstanceTypes']
self.validate_ec2_instance_type(ec2_instance_types)