def prompt_version(self): """Prompts for Gluu versions """ versions, version_number = get_supported_versions() if not self.settings.get("CN_VERSION"): self.settings.set("CN_VERSION", click.prompt( "Please enter the current version of Gluu or the version to be installed", default=version_number, )) image_names_and_tags = versions.get(self.settings.get("CN_VERSION"), {}) # override non-empty image name and tag self.settings.update({ k: v for k, v in image_names_and_tags.items() if not self.settings.get(k) })
class UpgradeForm(FlaskForm): """ Gluu upgrade form Fields : gluu_version (string|required) """ versions, version_number = get_supported_versions() supported_versions = [] for k, _ in versions.items(): supported_versions.append((k, k)) upgrade_target_version = RadioField( "Please enter the version to upgrade Gluu to", choices=supported_versions, default=version_number, validators=[DataRequired(message="Please select version")])
def prompt_version(self): """Prompts for Gluu versions """ versions, version_number = get_supported_versions() if self.settings.get("installer-settings.currentVersion") in (None, ''): self.settings.set( "installer-settings.currentVersion", click.prompt( "Please enter the current version of Gluu or the version to be installed", default=version_number, )) image_names_and_tags = versions.get( self.settings.get("installer-settings.currentVersion"), {}) # override non-empty image name and tag for k, v in image_names_and_tags.items(): if self.settings.get(k) in (None, ''): self.settings.set(k, v)
def prompt_upgrade(self): """Prompts for upgrade and returns updated settings. :return: """ versions, version_number = get_supported_versions() if self.settings.get("installer-settings.upgrade.targetVersion") in ( None, ''): self.settings.set( "installer-settings.upgrade.targetVersion", click.prompt( "Please enter the version to upgrade Gluu to", default=version_number, )) image_names_and_tags = versions.get( self.settings.get("installer-settings.upgrade.targetVersion"), {}) self.settings.update(image_names_and_tags) # reset this config to force image prompt self.settings.set("installer-settings.image.edit", "") PromptImages(self.settings).prompt_image_name_tag()
def prompt_upgrade(self): """Prompts for upgrade and returns updated settings. :return: """ versions, version_number = get_supported_versions() self.enabled_services.append("upgrade") self.settings.set("ENABLED_SERVICES_LIST", self.enabled_services) if not self.settings.get("CN_UPGRADE_TARGET_VERSION"): self.settings.set( "CN_UPGRADE_TARGET_VERSION", click.prompt( "Please enter the version to upgrade Gluu to", default=version_number, )) image_names_and_tags = versions.get( self.settings.get("CN_UPGRADE_TARGET_VERSION"), {}) self.settings.update(image_names_and_tags) # reset this config to force image prompt self.settings.set("EDIT_IMAGE_NAMES_TAGS", "") PromptImages(self.settings).prompt_image_name_tag()