def _CreateApp(self, project): """Walks the user through creating an AppEngine app.""" if console_io.PromptContinue( message=('There is no App Engine app in project [{}].'.format(project)), prompt_string=('Would you like to create one'), throw_if_unattended=True): try: app_engine_api_client = app_engine_api.GetApiClientForTrack( calliope_base.ReleaseTrack.GA) create_util.CreateAppInteractively(app_engine_api_client, project) except create_util.AppAlreadyExistsError: raise create_util.AppAlreadyExistsError( 'App already exists in project [{}]. This may be due a race ' 'condition. Please try again.'.format(project)) else: return self._GetLocation(project) return None
def _CreateApp(app_engine_api_client): """Walks the user through creating an AppEngine app.""" project = properties.VALUES.core.project.GetOrFail() if console_io.PromptContinue( message=( 'There is no App Engine app in project [{}].'.format(project)), prompt_string=('Would you like to create one'), throw_if_unattended=True): try: create_util.CreateAppInteractively( app_engine_api_client, project, regions=constants.VALID_REGIONS, extra_warning=_MORE_REGIONS_AVAILABLE_WARNING) except create_util.AppAlreadyExistsError: raise create_util.AppAlreadyExistsError( 'App already exists in project [{}]. This may be due a race ' 'condition. Please try again.'.format(project)) else: return _GetApp(app_engine_api_client) return None