From f4e9b3689de77698e90aeb68094c9b7686df7307 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 9 May 2022 15:05:54 +0200 Subject: [PATCH] [users] Remove legacy settings --- src/modules/users/Config.cpp | 25 ------------------------- src/modules/users/users.conf | 15 --------------- src/modules/users/users.schema.yaml | 8 ++------ 3 files changed, 2 insertions(+), 46 deletions(-) diff --git a/src/modules/users/Config.cpp b/src/modules/users/Config.cpp index 5d10793ca..007bf705e 100644 --- a/src/modules/users/Config.cpp +++ b/src/modules/users/Config.cpp @@ -858,25 +858,6 @@ either( T ( *f )( const QVariantMap&, const QString&, U ), } } -// TODO:3.3: Remove -static void -copyLegacy( const QVariantMap& source, const QString& sourceKey, QVariantMap& target, const QString& targetKey ) -{ - if ( source.contains( sourceKey ) ) - { - if ( target.contains( targetKey ) ) - { - cWarning() << "Legacy *users* key" << sourceKey << "ignored."; - } - else - { - const QVariant legacyValue = source.value( sourceKey ); - cWarning() << "Legacy *users* key" << sourceKey << "overrides hostname-settings."; - target.insert( targetKey, legacyValue ); - } - } -} - /** @brief Tidy up a list of names * * Remove duplicates, apply lowercase, sort. @@ -897,9 +878,6 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) bool ok = false; // Ignored QVariantMap userSettings = CalamaresUtils::getSubMap( configurationMap, "user", ok ); - // TODO:3.3: Remove calls to copyLegacy - copyLegacy( configurationMap, "userShell", userSettings, "shell" ); - QString shell( QLatin1String( "/bin/bash" ) ); // as if it's not set at all if ( userSettings.contains( "shell" ) ) { @@ -925,9 +903,6 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) bool ok = false; // Ignored QVariantMap hostnameSettings = CalamaresUtils::getSubMap( configurationMap, "hostname", ok ); - // TODO:3.3: Remove calls to copyLegacy - copyLegacy( configurationMap, "setHostname", hostnameSettings, "location" ); - copyLegacy( configurationMap, "writeHostsFile", hostnameSettings, "writeHostsFile" ); m_hostnameAction = getHostNameAction( hostnameSettings ); m_writeEtcHosts = CalamaresUtils::getBool( hostnameSettings, "writeHostsFile", true ); m_hostnameTemplate diff --git a/src/modules/users/users.conf b/src/modules/users/users.conf index 779d1afdf..00a98ee7f 100644 --- a/src/modules/users/users.conf +++ b/src/modules/users/users.conf @@ -161,10 +161,6 @@ allowWeakPasswordsDefault: false user: shell: /bin/bash forbidden_names: [ root ] -# TODO:3.3: Remove this setting -# -# This is the legacy setting for user.shell -userShell: /bin/bash # Hostname settings # @@ -212,17 +208,6 @@ hostname: template: "derp-${cpu}" forbidden_names: [ localhost ] -# TODO:3.3: Remove this setting -# -# This is a legacy setting for hostname.location; if it is set -# at all, and there is no setting for hostname.location, it is used. -setHostname: EtcFile - -# TODO:3.3: Remove this setting -# -# This is a legacy setting for hostname.writeHostsFile -writeHostsFile: true - presets: fullName: # value: "OEM User" diff --git a/src/modules/users/users.schema.yaml b/src/modules/users/users.schema.yaml index 025f8a3d2..972306b80 100644 --- a/src/modules/users/users.schema.yaml +++ b/src/modules/users/users.schema.yaml @@ -6,13 +6,12 @@ $id: https://calamares.io/schemas/users additionalProperties: false type: object properties: - # User shell, should be path to /bin/sh or so - userShell: { type: string } user: additionalProperties: false type: object properties: - shell: { type: string } # Overrides userShell + # User shell, should be path to /bin/sh or so + shell: { type: string } forbidden_names: { type: array, items: { type: string } } # Group settings defaultGroups: @@ -54,9 +53,6 @@ properties: writeHostsFile: { type: boolean, default: true } template: { type: string, default: "${first}-${product}" } forbidden_names: { type: array, items: { type: string } } - # Legacy Hostname setting - setHostname: { type: string, enum: [ None, EtcFile, Hostnamed ] } - writeHostsFile: { type: boolean, default: true } # Presets #