def _choose_target_name(self): has_raw_profile = (self.raw_profile_data and self.profile_name and self.profile_name in self.raw_profile_data) if has_raw_profile: raw_profile = self.raw_profile_data[self.profile_name] target_name, _ = Profile.render_profile( raw_profile, self.profile_name, getattr(self.args, 'target', None), self.cli_vars) return target_name return None
def _choose_target_name(self): has_raw_profile = (self.raw_profile_data and self.profile_name and self.profile_name in self.raw_profile_data) if has_raw_profile: raw_profile = self.raw_profile_data[self.profile_name] target_name, _ = Profile.render_profile( raw_profile, self.profile_name, getattr(self.args, 'target', None), self.cli_vars ) return target_name return None
def _choose_target_name(self, profile_name: str): has_raw_profile = (self.raw_profile_data is not None and profile_name in self.raw_profile_data) if not has_raw_profile: return None # mypy appeasement, we checked just above assert self.raw_profile_data is not None raw_profile = self.raw_profile_data[profile_name] renderer = ProfileRenderer(generate_base_context(self.cli_vars)) target_name, _ = Profile.render_profile(raw_profile=raw_profile, profile_name=profile_name, target_override=getattr( self.args, 'target', None), renderer=renderer) return target_name