From 6fa3681228a1800f57e57c90c3c89b24c14ac42a Mon Sep 17 00:00:00 2001 From: Catherine Redfield Date: Thu, 21 Sep 2023 13:41:36 -0400 Subject: [PATCH] feat: warn/confirm with user if enabling fips downgrades the kernel This change adds a new message prompting the user to confirm if enabling fips downgrades the kernel. --- debian/po/pt_BR.po | 388 ++++++++++++----------- debian/po/ubuntu-pro.pot | 388 ++++++++++++----------- features/enable_fips_pro.feature | 22 +- types-requirements.txt | 1 + uaclient/apt.py | 12 + uaclient/entitlements/fips.py | 45 ++- uaclient/entitlements/tests/test_fips.py | 7 +- uaclient/messages/__init__.py | 7 + 8 files changed, 484 insertions(+), 386 deletions(-) diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po index 8ec6ec0247..186591a415 100644 --- a/debian/po/pt_BR.po +++ b/debian/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-04 21:27-0600\n" +"POT-Creation-Date: 2023-12-13 11:45-0500\n" "PO-Revision-Date: 2023-09-25 12:29-0400\n" "Last-Translator: Lucas Moura \n" "Language-Team: Brazilian Portuguese for interval must be a positive integer." @@ -3246,17 +3256,17 @@ msgstr "" "Não foi possível associar {key} a {value}: precisa ser um inteiro " "positivo." -#: ../../uaclient/messages/__init__.py:2343 +#: ../../uaclient/messages/__init__.py:2350 #, python-brace-format msgid "Invalid url in config. {key}: {value}" msgstr "url inválida no arquivo de configuração. {key}: {value}" -#: ../../uaclient/messages/__init__.py:2348 +#: ../../uaclient/messages/__init__.py:2355 #, python-brace-format msgid "Could not find yaml file: {filepath}" msgstr "Não foi possível encontrar o arquivo yaml: {filepath}" -#: ../../uaclient/messages/__init__.py:2354 +#: ../../uaclient/messages/__init__.py:2361 msgid "" "Error: Setting global apt proxy and pro scoped apt proxy\n" "at the same time is unsupported.\n" @@ -3267,27 +3277,27 @@ msgstr "" "pro de apt ao mesmo tempo não é suportado.\n" "Cancelando o processo de configuração.\n" -#: ../../uaclient/messages/__init__.py:2364 +#: ../../uaclient/messages/__init__.py:2371 msgid "Can't load the distro-info database." msgstr "Não foi possível carregar o banco de dados do distro-info." -#: ../../uaclient/messages/__init__.py:2369 +#: ../../uaclient/messages/__init__.py:2376 #, python-brace-format msgid "Can't find series {series} in the distro-info database." msgstr "" "Não foi possível encontrar a série {series} na banco de dados do distro-info." -#: ../../uaclient/messages/__init__.py:2374 +#: ../../uaclient/messages/__init__.py:2381 #, python-brace-format msgid "Error: Cannot use {option1} together with {option2}." msgstr "Erro: não é possível usar {option1} junto com {option2}" -#: ../../uaclient/messages/__init__.py:2378 +#: ../../uaclient/messages/__init__.py:2385 #, python-brace-format msgid "No help available for '{name}'" msgstr "Ajuda não disponível para '{name}'" -#: ../../uaclient/messages/__init__.py:2384 +#: ../../uaclient/messages/__init__.py:2391 #, python-brace-format msgid "" "Error: issue \"{issue}\" is not recognized.\n" @@ -3296,34 +3306,34 @@ msgstr "" "Erro: problema de segurnça \"{issue}\" não foi reconhecido.\n" "Use: \"pro fix CVE-yyyy-nnnn\" ou \"pro fix USN-nnnn\"" -#: ../../uaclient/messages/__init__.py:2390 +#: ../../uaclient/messages/__init__.py:2397 #, python-brace-format msgid "{arg} must be one of: {choices}" msgstr "{arg} precisa ser um de: {choices}" -#: ../../uaclient/messages/__init__.py:2395 +#: ../../uaclient/messages/__init__.py:2402 #, python-brace-format msgid "Expected {expected} but found: {actual}" msgstr "Esperava {expected} mas encontrou: {actual}" -#: ../../uaclient/messages/__init__.py:2399 +#: ../../uaclient/messages/__init__.py:2406 msgid "Unable to process uaclient.conf" msgstr "Falha ao processar uaclient.conf" -#: ../../uaclient/messages/__init__.py:2404 +#: ../../uaclient/messages/__init__.py:2411 msgid "Unable to refresh your subscription" msgstr "Falha ao atualizar sua assinatura" -#: ../../uaclient/messages/__init__.py:2409 +#: ../../uaclient/messages/__init__.py:2416 msgid "Unable to update Ubuntu Pro related APT and MOTD messages." msgstr "" "Falha ao atualizar as mensagens de APT e MOTD relacioandas ao Ubuntu Pro" -#: ../../uaclient/messages/__init__.py:2415 +#: ../../uaclient/messages/__init__.py:2422 msgid "json formatted response requires --assume-yes flag." msgstr "resposta formatada em json necessita do paramêtro --assume-yes" -#: ../../uaclient/messages/__init__.py:2423 +#: ../../uaclient/messages/__init__.py:2430 msgid "" "Do not pass the TOKEN arg if you are using --attach-config.\n" "Include the token in the attach-config file instead.\n" @@ -3333,50 +3343,50 @@ msgstr "" "Ao invés disso, inclua o token no arquivo de attach-config.\n" " " -#: ../../uaclient/messages/__init__.py:2432 +#: ../../uaclient/messages/__init__.py:2439 msgid "Cannot provide both --args and --data at the same time" msgstr "Não é possível usar --args e --data ao mesmo tempo" -#: ../../uaclient/messages/__init__.py:2438 +#: ../../uaclient/messages/__init__.py:2445 #, python-brace-format msgid "Unable to perform: {lock_request}.\n" msgstr "Falha ao executar: {lock_request}.\n" -#: ../../uaclient/messages/__init__.py:2447 +#: ../../uaclient/messages/__init__.py:2454 msgid "This command must be run as root (try using sudo)." msgstr "Esse comando precisa ser executado como root (tente usando sudo)." -#: ../../uaclient/messages/__init__.py:2452 +#: ../../uaclient/messages/__init__.py:2459 #, python-brace-format msgid "Metadata for {issue} is invalid. Error: {error_msg}." msgstr "Metadados para {issue} não são válidos. Erro: {error_msg}." -#: ../../uaclient/messages/__init__.py:2459 +#: ../../uaclient/messages/__init__.py:2466 #, python-brace-format msgid "Error: {issue_id} not found." msgstr "Erro: {issue_id} não encontrada." -#: ../../uaclient/messages/__init__.py:2463 +#: ../../uaclient/messages/__init__.py:2470 #, python-brace-format msgid "GPG key '{keyfile}' not found." msgstr "chave GPG '{keyfile}' não foi encontrada" -#: ../../uaclient/messages/__init__.py:2468 +#: ../../uaclient/messages/__init__.py:2475 #, python-brace-format msgid "'{endpoint}' is not a valid endpoint" msgstr "'{endpoint}' não é um endpoint válido" -#: ../../uaclient/messages/__init__.py:2473 +#: ../../uaclient/messages/__init__.py:2480 #, python-brace-format msgid "Missing argument '{arg}' for endpoint {endpoint}" msgstr "'{arg}' está faltando para endpoint {endpoint}" -#: ../../uaclient/messages/__init__.py:2478 +#: ../../uaclient/messages/__init__.py:2485 #, python-brace-format msgid "{endpoint} accepts no arguments" msgstr "{endpoint} não aceita paramêtros" -#: ../../uaclient/messages/__init__.py:2483 +#: ../../uaclient/messages/__init__.py:2490 #, python-brace-format msgid "" "Error parsing API json data parameter:\n" @@ -3385,32 +3395,32 @@ msgstr "" "Error ao analisar paramêtro data para API json:\n" "{data}" -#: ../../uaclient/messages/__init__.py:2488 +#: ../../uaclient/messages/__init__.py:2495 #, python-brace-format msgid "'{arg}' is not formatted as 'key=value'" msgstr "'{arg}' não está formatado como 'chave=valor'" -#: ../../uaclient/messages/__init__.py:2493 +#: ../../uaclient/messages/__init__.py:2500 #, python-brace-format msgid "Unable to determine version: {error_msg}" msgstr "Não foi possível determinar a versão: {error_msg}" -#: ../../uaclient/messages/__init__.py:2498 +#: ../../uaclient/messages/__init__.py:2505 msgid "features.disable_auto_attach set in config" msgstr "features.disable_auto_attach definida na configuração" -#: ../../uaclient/messages/__init__.py:2503 +#: ../../uaclient/messages/__init__.py:2510 #, python-brace-format msgid "Unable to determine unattended-upgrades status: {error_msg}" msgstr "" "Não foi possível determinar o status do unattended-upgrades: {error_msg}" -#: ../../uaclient/messages/__init__.py:2509 +#: ../../uaclient/messages/__init__.py:2516 #, python-brace-format msgid "Expected value with type {expected_type} but got type: {got_type}" msgstr "Esperava valor com tipo {expected_type}, mas recebeu tipo {got_type}" -#: ../../uaclient/messages/__init__.py:2515 +#: ../../uaclient/messages/__init__.py:2522 #, python-brace-format msgid "" "Got value with incorrect type at index {index}:\n" @@ -3419,7 +3429,7 @@ msgstr "" "Valor com tipo incorreto na posição {index}:\n" "{nested_msg}" -#: ../../uaclient/messages/__init__.py:2521 +#: ../../uaclient/messages/__init__.py:2528 #, python-brace-format msgid "" "Got value with incorrect type for field \"{key}\":\n" @@ -3428,7 +3438,7 @@ msgstr "" "Valor com tipo incorreto para o campo \"{key}\":\n" "{nested_msg}" -#: ../../uaclient/messages/__init__.py:2528 +#: ../../uaclient/messages/__init__.py:2535 #, python-brace-format msgid "Value provided was not found in {enum_class}'s allowed: value: {values}" msgstr "" diff --git a/debian/po/ubuntu-pro.pot b/debian/po/ubuntu-pro.pot index 18271ea1fb..9d4dd4e2ce 100644 --- a/debian/po/ubuntu-pro.pot +++ b/debian/po/ubuntu-pro.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-04 21:27-0600\n" +"POT-Creation-Date: 2023-12-13 11:45-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1982,43 +1982,53 @@ msgid "" msgstr "" #: ../../uaclient/messages/__init__.py:1304 +#, python-brace-format +msgid "" +"This will downgrade the kernel from {current_version} to {new_version}.\n" +"Warning: Downgrading the kernel may cause hardware failures. Please ensure " +"the\n" +" hardware is compatible with the new kernel version before " +"proceeding.\n" +msgstr "" + +#: ../../uaclient/messages/__init__.py:1311 msgid "FIPS support requires system reboot to complete configuration." msgstr "" -#: ../../uaclient/messages/__init__.py:1306 -#: ../../uaclient/messages/__init__.py:1737 +#: ../../uaclient/messages/__init__.py:1313 +#: ../../uaclient/messages/__init__.py:1744 msgid "Reboot to FIPS kernel required" msgstr "" -#: ../../uaclient/messages/__init__.py:1308 +#: ../../uaclient/messages/__init__.py:1315 msgid "This FIPS install is out of date, run: sudo pro enable fips" msgstr "" -#: ../../uaclient/messages/__init__.py:1311 +#: ../../uaclient/messages/__init__.py:1318 msgid "Disabling FIPS requires system reboot to complete operation." msgstr "" -#: ../../uaclient/messages/__init__.py:1314 +#: ../../uaclient/messages/__init__.py:1321 #, python-brace-format msgid "{service} {pkg} package could not be installed" msgstr "" -#: ../../uaclient/messages/__init__.py:1317 +#: ../../uaclient/messages/__init__.py:1324 msgid "" "Please run `apt upgrade` to ensure all FIPS packages are updated to the " "correct\n" "version.\n" msgstr "" -#: ../../uaclient/messages/__init__.py:1323 +#: ../../uaclient/messages/__init__.py:1330 msgid "FIPS Updates" msgstr "" -#: ../../uaclient/messages/__init__.py:1325 +#: ../../uaclient/messages/__init__.py:1332 msgid "FIPS compliant crypto packages with stable security updates" msgstr "" -#: ../../uaclient/messages/__init__.py:1328 +#: ../../uaclient/messages/__init__.py:1335 #, python-brace-format msgid "" "fips-updates installs FIPS 140 crypto packages including all security " @@ -2027,21 +2037,21 @@ msgid "" "You can find out more at {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:1334 +#: ../../uaclient/messages/__init__.py:1341 msgid "FIPS Preview" msgstr "" -#: ../../uaclient/messages/__init__.py:1336 +#: ../../uaclient/messages/__init__.py:1343 msgid "Preview of FIPS crypto packages undergoing certification with NIST" msgstr "" -#: ../../uaclient/messages/__init__.py:1339 +#: ../../uaclient/messages/__init__.py:1346 msgid "" "Installs FIPS crypto packages that are under certification with NIST,\n" "for FedRAMP, FISMA and compliance use cases." msgstr "" -#: ../../uaclient/messages/__init__.py:1344 +#: ../../uaclient/messages/__init__.py:1351 msgid "" "This will install crypto packages that have been submitted to NIST for " "review\n" @@ -2053,15 +2063,15 @@ msgid "" "Warning: This action can take some time and cannot be undone.\n" msgstr "" -#: ../../uaclient/messages/__init__.py:1355 +#: ../../uaclient/messages/__init__.py:1362 msgid "Landscape" msgstr "" -#: ../../uaclient/messages/__init__.py:1357 +#: ../../uaclient/messages/__init__.py:1364 msgid "Management and administration tool for Ubuntu" msgstr "" -#: ../../uaclient/messages/__init__.py:1360 +#: ../../uaclient/messages/__init__.py:1367 #, python-brace-format msgid "" "Landscape Client can be installed on this machine and enrolled in " @@ -2074,15 +2084,15 @@ msgid "" "more. Find out more about Landscape at {home_url}" msgstr "" -#: ../../uaclient/messages/__init__.py:1373 +#: ../../uaclient/messages/__init__.py:1380 msgid "Livepatch" msgstr "" -#: ../../uaclient/messages/__init__.py:1374 +#: ../../uaclient/messages/__init__.py:1381 msgid "Canonical Livepatch service" msgstr "" -#: ../../uaclient/messages/__init__.py:1376 +#: ../../uaclient/messages/__init__.py:1383 #, python-brace-format msgid "" "Livepatch provides selected high and critical kernel CVE fixes and other\n" @@ -2097,42 +2107,42 @@ msgid "" "service at {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:1385 +#: ../../uaclient/messages/__init__.py:1392 msgid "Current kernel is not supported" msgstr "" -#: ../../uaclient/messages/__init__.py:1388 +#: ../../uaclient/messages/__init__.py:1395 #, python-brace-format msgid "Supported livepatch kernels are listed here: {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:1391 +#: ../../uaclient/messages/__init__.py:1398 #, python-brace-format msgid "Unable to configure livepatch: {error_msg}" msgstr "" -#: ../../uaclient/messages/__init__.py:1393 +#: ../../uaclient/messages/__init__.py:1400 msgid "Unable to enable Livepatch: " msgstr "" -#: ../../uaclient/messages/__init__.py:1395 +#: ../../uaclient/messages/__init__.py:1402 msgid "Disabling Livepatch prior to re-attach with new token" msgstr "" -#: ../../uaclient/messages/__init__.py:1398 +#: ../../uaclient/messages/__init__.py:1405 msgid "Livepatch support requires a system reboot across LTS upgrade." msgstr "" -#: ../../uaclient/messages/__init__.py:1401 -#: ../../uaclient/messages/__init__.py:1414 +#: ../../uaclient/messages/__init__.py:1408 +#: ../../uaclient/messages/__init__.py:1421 msgid "Real-time kernel" msgstr "" -#: ../../uaclient/messages/__init__.py:1403 +#: ../../uaclient/messages/__init__.py:1410 msgid "Ubuntu kernel with PREEMPT_RT patches integrated" msgstr "" -#: ../../uaclient/messages/__init__.py:1406 +#: ../../uaclient/messages/__init__.py:1413 msgid "" "The Real-time kernel is an Ubuntu kernel with PREEMPT_RT patches integrated. " "It\n" @@ -2145,27 +2155,27 @@ msgid "" "Livepatch." msgstr "" -#: ../../uaclient/messages/__init__.py:1416 +#: ../../uaclient/messages/__init__.py:1423 msgid "Generic version of the RT kernel (default)" msgstr "" -#: ../../uaclient/messages/__init__.py:1418 +#: ../../uaclient/messages/__init__.py:1425 msgid "Real-time NVIDIA Tegra Kernel" msgstr "" -#: ../../uaclient/messages/__init__.py:1420 +#: ../../uaclient/messages/__init__.py:1427 msgid "RT kernel optimized for NVIDIA Tegra platform" msgstr "" -#: ../../uaclient/messages/__init__.py:1422 +#: ../../uaclient/messages/__init__.py:1429 msgid "Real-time Intel IOTG Kernel" msgstr "" -#: ../../uaclient/messages/__init__.py:1424 +#: ../../uaclient/messages/__init__.py:1431 msgid "RT kernel optimized for Intel IOTG platform" msgstr "" -#: ../../uaclient/messages/__init__.py:1427 +#: ../../uaclient/messages/__init__.py:1434 #, python-brace-format msgid "" "The Real-time kernel is an Ubuntu kernel with PREEMPT_RT patches " @@ -2178,7 +2188,7 @@ msgid "" "Do you want to continue? [ default = Yes ]: (Y/n) " msgstr "" -#: ../../uaclient/messages/__init__.py:1438 +#: ../../uaclient/messages/__init__.py:1445 msgid "" "This will remove the boot order preference for the Real-time kernel and\n" "disable updates to the Real-time kernel.\n" @@ -2195,15 +2205,15 @@ msgid "" "Are you sure? (y/N) " msgstr "" -#: ../../uaclient/messages/__init__.py:1454 +#: ../../uaclient/messages/__init__.py:1461 msgid "ROS ESM Security Updates" msgstr "" -#: ../../uaclient/messages/__init__.py:1455 +#: ../../uaclient/messages/__init__.py:1462 msgid "Security Updates for the Robot Operating System" msgstr "" -#: ../../uaclient/messages/__init__.py:1457 +#: ../../uaclient/messages/__init__.py:1464 #, python-brace-format msgid "" "ros provides access to a private PPA which includes security-related " @@ -2216,15 +2226,15 @@ msgid "" "{url}" msgstr "" -#: ../../uaclient/messages/__init__.py:1466 +#: ../../uaclient/messages/__init__.py:1473 msgid "ROS ESM All Updates" msgstr "" -#: ../../uaclient/messages/__init__.py:1468 +#: ../../uaclient/messages/__init__.py:1475 msgid "All Updates for the Robot Operating System" msgstr "" -#: ../../uaclient/messages/__init__.py:1471 +#: ../../uaclient/messages/__init__.py:1478 #, python-brace-format msgid "" "ros-updates provides access to a private PPA that includes non-security-" @@ -2237,14 +2247,14 @@ msgid "" "{url}" msgstr "" -#: ../../uaclient/messages/__init__.py:1542 +#: ../../uaclient/messages/__init__.py:1549 msgid "" "Unexpected error(s) occurred.\n" "For more details, see the log: /var/log/ubuntu-advantage.log\n" "To file a bug run: ubuntu-bug ubuntu-advantage-tools" msgstr "" -#: ../../uaclient/messages/__init__.py:1552 +#: ../../uaclient/messages/__init__.py:1559 #, python-brace-format msgid "" "Failed to access URL: {url}\n" @@ -2252,7 +2262,7 @@ msgid "" "Please install \"ca-certificates\" and try again." msgstr "" -#: ../../uaclient/messages/__init__.py:1562 +#: ../../uaclient/messages/__init__.py:1569 #, python-brace-format msgid "" "Failed to access URL: {url}\n" @@ -2260,209 +2270,209 @@ msgid "" "Please check your openssl configuration." msgstr "" -#: ../../uaclient/messages/__init__.py:1571 +#: ../../uaclient/messages/__init__.py:1578 #, python-brace-format msgid "Ignoring unknown argument '{arg}'" msgstr "" -#: ../../uaclient/messages/__init__.py:1577 +#: ../../uaclient/messages/__init__.py:1584 #, python-brace-format msgid "" "A new version of the client is available: {version}. Please upgrade to the " "latest version to get the new features and bug fixes." msgstr "" -#: ../../uaclient/messages/__init__.py:1584 +#: ../../uaclient/messages/__init__.py:1591 #, python-brace-format msgid "{title} does not support being enabled with --access-only" msgstr "" -#: ../../uaclient/messages/__init__.py:1589 +#: ../../uaclient/messages/__init__.py:1596 #, python-brace-format msgid "{title} does not support being disabled with --purge" msgstr "" -#: ../../uaclient/messages/__init__.py:1595 +#: ../../uaclient/messages/__init__.py:1602 #, python-brace-format msgid "Cannot disable dependent service: {required_service}{error}" msgstr "" -#: ../../uaclient/messages/__init__.py:1602 +#: ../../uaclient/messages/__init__.py:1609 #, python-brace-format msgid "" "Cannot disable {service_being_disabled} when {dependent_service} is " "enabled.\n" msgstr "" -#: ../../uaclient/messages/__init__.py:1610 +#: ../../uaclient/messages/__init__.py:1617 #, python-brace-format msgid "Cannot disable {entitlement_name} with purge: no origin value defined" msgstr "" -#: ../../uaclient/messages/__init__.py:1617 +#: ../../uaclient/messages/__init__.py:1624 #, python-brace-format msgid "Cannot enable required service: {service}{error}" msgstr "" -#: ../../uaclient/messages/__init__.py:1622 +#: ../../uaclient/messages/__init__.py:1629 #, python-brace-format msgid "" "Cannot enable {service_being_enabled} when {required_service} is disabled.\n" msgstr "" -#: ../../uaclient/messages/__init__.py:1630 +#: ../../uaclient/messages/__init__.py:1637 #, python-brace-format msgid "" "Cannot enable {service_being_enabled} when {incompatible_service} is enabled." msgstr "" -#: ../../uaclient/messages/__init__.py:1638 +#: ../../uaclient/messages/__init__.py:1645 #, python-brace-format msgid "Cannot install {title} on a container." msgstr "" -#: ../../uaclient/messages/__init__.py:1641 +#: ../../uaclient/messages/__init__.py:1648 #, python-brace-format msgid "{title} is not configured" msgstr "" -#: ../../uaclient/messages/__init__.py:1646 +#: ../../uaclient/messages/__init__.py:1653 #, python-brace-format msgid "" "The {service} service is not enabled because the {package} package is\n" "not installed." msgstr "" -#: ../../uaclient/messages/__init__.py:1652 +#: ../../uaclient/messages/__init__.py:1659 #, python-brace-format msgid "{title} is active" msgstr "" -#: ../../uaclient/messages/__init__.py:1656 +#: ../../uaclient/messages/__init__.py:1663 #, python-brace-format msgid "{title} does not have an aptURL directive" msgstr "" -#: ../../uaclient/messages/__init__.py:1661 +#: ../../uaclient/messages/__init__.py:1668 #, python-brace-format msgid "" "{title} is not currently enabled\n" "See: sudo pro status" msgstr "" -#: ../../uaclient/messages/__init__.py:1668 +#: ../../uaclient/messages/__init__.py:1675 #, python-brace-format msgid "" "{title} is already enabled.\n" "See: sudo pro status" msgstr "" -#: ../../uaclient/messages/__init__.py:1675 +#: ../../uaclient/messages/__init__.py:1682 #, python-brace-format msgid "" "This subscription is not entitled to {{title}}\n" "View your subscription at: {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:1681 +#: ../../uaclient/messages/__init__.py:1688 #, python-brace-format msgid "{title} is not entitled" msgstr "" -#: ../../uaclient/messages/__init__.py:1687 +#: ../../uaclient/messages/__init__.py:1694 #, python-brace-format msgid "" "{title} is not available for kernel {kernel}.\n" "Minimum kernel version required: {min_kernel}." msgstr "" -#: ../../uaclient/messages/__init__.py:1695 +#: ../../uaclient/messages/__init__.py:1702 #, python-brace-format msgid "" "{title} is not available for kernel {kernel}.\n" "Supported flavors are: {supported_kernels}." msgstr "" -#: ../../uaclient/messages/__init__.py:1703 +#: ../../uaclient/messages/__init__.py:1710 #, python-brace-format msgid "{title} is not available for Ubuntu {series}." msgstr "" -#: ../../uaclient/messages/__init__.py:1710 +#: ../../uaclient/messages/__init__.py:1717 #, python-brace-format msgid "" "{title} is not available for platform {arch}.\n" "Supported platforms are: {supported_arches}." msgstr "" -#: ../../uaclient/messages/__init__.py:1718 +#: ../../uaclient/messages/__init__.py:1725 #, python-brace-format msgid "" "{title} is not available for CPU vendor {vendor}.\n" "Supported CPU vendors are: {supported_vendors}." msgstr "" -#: ../../uaclient/messages/__init__.py:1725 +#: ../../uaclient/messages/__init__.py:1732 msgid "no entitlement affordances checked" msgstr "" -#: ../../uaclient/messages/__init__.py:1731 +#: ../../uaclient/messages/__init__.py:1738 #, python-brace-format msgid "" "Ubuntu {{series}} does not provide {{cloud}} optimized FIPS kernel\n" "For help see: {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:1741 +#: ../../uaclient/messages/__init__.py:1748 #, python-brace-format msgid "Cannot enable {fips} when {fips_updates} is enabled." msgstr "" -#: ../../uaclient/messages/__init__.py:1744 +#: ../../uaclient/messages/__init__.py:1751 #, python-brace-format msgid "{file_name} is not set to 1" msgstr "" -#: ../../uaclient/messages/__init__.py:1748 +#: ../../uaclient/messages/__init__.py:1755 #, python-brace-format msgid "Cannot enable {fips} because {fips_updates} was once enabled." msgstr "" -#: ../../uaclient/messages/__init__.py:1753 +#: ../../uaclient/messages/__init__.py:1760 msgid "" "FIPS cannot be enabled if FIPS Updates has ever been enabled because FIPS " "Updates installs security patches that aren't officially certified." msgstr "" -#: ../../uaclient/messages/__init__.py:1761 +#: ../../uaclient/messages/__init__.py:1768 msgid "" "FIPS Updates cannot be enabled if FIPS is enabled. FIPS Updates installs " "security patches that aren't officially certified." msgstr "" -#: ../../uaclient/messages/__init__.py:1770 +#: ../../uaclient/messages/__init__.py:1777 msgid "" "Livepatch cannot be enabled while running the official FIPS certified " "kernel. If you would like a FIPS compliant kernel with additional bug fixes " "and security updates, you can use the FIPS Updates service with Livepatch." msgstr "" -#: ../../uaclient/messages/__init__.py:1778 +#: ../../uaclient/messages/__init__.py:1785 msgid "canonical-livepatch snap is not installed." msgstr "" -#: ../../uaclient/messages/__init__.py:1782 +#: ../../uaclient/messages/__init__.py:1789 msgid "Cannot enable Livepatch when FIPS is enabled." msgstr "" -#: ../../uaclient/messages/__init__.py:1787 +#: ../../uaclient/messages/__init__.py:1794 msgid "" "The running kernel has reached the end of its active livepatch window.\n" "Please upgrade the kernel with apt and reboot for continued livepatch " "support." msgstr "" -#: ../../uaclient/messages/__init__.py:1795 +#: ../../uaclient/messages/__init__.py:1802 #, python-brace-format msgid "" "The current kernel ({{version}}, {{arch}}) has reached the end of its " @@ -2472,7 +2482,7 @@ msgid "" "this warning." msgstr "" -#: ../../uaclient/messages/__init__.py:1804 +#: ../../uaclient/messages/__init__.py:1811 #, python-brace-format msgid "" "The current kernel ({{version}}, {{arch}}) is not supported by livepatch.\n" @@ -2481,87 +2491,87 @@ msgid "" "this warning." msgstr "" -#: ../../uaclient/messages/__init__.py:1814 +#: ../../uaclient/messages/__init__.py:1821 msgid "canonical-livepatch status didn't finish successfully" msgstr "" -#: ../../uaclient/messages/__init__.py:1820 +#: ../../uaclient/messages/__init__.py:1827 #, python-brace-format msgid "" "Error running canonical-livepatch status:\n" "{livepatch_error}" msgstr "" -#: ../../uaclient/messages/__init__.py:1829 +#: ../../uaclient/messages/__init__.py:1836 msgid "" "Realtime and FIPS require different kernels, so you cannot enable both at " "the same time." msgstr "" -#: ../../uaclient/messages/__init__.py:1836 +#: ../../uaclient/messages/__init__.py:1843 msgid "" "Realtime and FIPS Updates require different kernels, so you cannot enable " "both at the same time." msgstr "" -#: ../../uaclient/messages/__init__.py:1843 +#: ../../uaclient/messages/__init__.py:1850 msgid "Livepatch is not currently supported for the Real-time kernel." msgstr "" -#: ../../uaclient/messages/__init__.py:1848 +#: ../../uaclient/messages/__init__.py:1855 #, python-brace-format msgid "{service} cannot be enabled together with {variant}" msgstr "" -#: ../../uaclient/messages/__init__.py:1852 +#: ../../uaclient/messages/__init__.py:1859 msgid "Cannot install Real-time kernel on a container." msgstr "" -#: ../../uaclient/messages/__init__.py:1857 +#: ../../uaclient/messages/__init__.py:1864 msgid "apt-daily.timer jobs are not running" msgstr "" -#: ../../uaclient/messages/__init__.py:1861 +#: ../../uaclient/messages/__init__.py:1868 #, python-brace-format msgid "{cfg_name} is empty" msgstr "" -#: ../../uaclient/messages/__init__.py:1865 +#: ../../uaclient/messages/__init__.py:1872 #, python-brace-format msgid "{cfg_name} is turned off" msgstr "" -#: ../../uaclient/messages/__init__.py:1869 +#: ../../uaclient/messages/__init__.py:1876 msgid "unattended-upgrades package is not installed" msgstr "" -#: ../../uaclient/messages/__init__.py:1874 +#: ../../uaclient/messages/__init__.py:1881 msgid "landscape-client is not installed" msgstr "" -#: ../../uaclient/messages/__init__.py:1879 +#: ../../uaclient/messages/__init__.py:1886 msgid "" "Landscape is installed but not configured.\n" "Run `sudo landscape-config` to set it up, or run `sudo pro disable landscape`" msgstr "" -#: ../../uaclient/messages/__init__.py:1888 +#: ../../uaclient/messages/__init__.py:1895 msgid "" "Landscape is installed and configured but not registered.\n" "Run `sudo landscape-config` to register, or run `sudo pro disable landscape`" msgstr "" -#: ../../uaclient/messages/__init__.py:1897 +#: ../../uaclient/messages/__init__.py:1904 msgid "" "Landscape is installed and configured and registered but not running.\n" "Run `sudo landscape-config` to start it, or run `sudo pro disable landscape`" msgstr "" -#: ../../uaclient/messages/__init__.py:1905 +#: ../../uaclient/messages/__init__.py:1912 msgid "landscape-config command failed" msgstr "" -#: ../../uaclient/messages/__init__.py:1911 +#: ../../uaclient/messages/__init__.py:1918 #, python-brace-format msgid "" "Error: issue \"{issue_id}\" is not recognized.\n" @@ -2571,28 +2581,28 @@ msgid "" "USNs should follow the pattern USN-nnnn." msgstr "" -#: ../../uaclient/messages/__init__.py:1925 +#: ../../uaclient/messages/__init__.py:1932 msgid "Another process is running APT." msgstr "" -#: ../../uaclient/messages/__init__.py:1931 +#: ../../uaclient/messages/__init__.py:1938 #, python-brace-format msgid "" "APT update failed to read APT config for the following:\n" "{failed_repos}" msgstr "" -#: ../../uaclient/messages/__init__.py:1961 +#: ../../uaclient/messages/__init__.py:1968 #, python-brace-format msgid "Invalid APT credentials provided for {repo}" msgstr "" -#: ../../uaclient/messages/__init__.py:1966 +#: ../../uaclient/messages/__init__.py:1973 #, python-brace-format msgid "Timeout trying to access APT repository at {repo}" msgstr "" -#: ../../uaclient/messages/__init__.py:1972 +#: ../../uaclient/messages/__init__.py:1979 #, python-brace-format msgid "" "Unexpected APT error.\n" @@ -2600,106 +2610,106 @@ msgid "" "See /var/log/ubuntu-advantage.log" msgstr "" -#: ../../uaclient/messages/__init__.py:1982 +#: ../../uaclient/messages/__init__.py:1989 #, python-brace-format msgid "" "Cannot validate credentials for APT repo. Timeout after {seconds} seconds " "trying to reach {repo}." msgstr "" -#: ../../uaclient/messages/__init__.py:1989 +#: ../../uaclient/messages/__init__.py:1996 #, python-brace-format msgid "snap {snap} is not installed or doesn't exist" msgstr "" -#: ../../uaclient/messages/__init__.py:1994 +#: ../../uaclient/messages/__init__.py:2001 #, python-brace-format msgid "" "Unexpected SNAPD API error\n" "{error}" msgstr "" -#: ../../uaclient/messages/__init__.py:1998 +#: ../../uaclient/messages/__init__.py:2005 msgid "Could not reach the SNAPD API" msgstr "" -#: ../../uaclient/messages/__init__.py:2002 +#: ../../uaclient/messages/__init__.py:2009 msgid "Failed to install snapd on the system" msgstr "" -#: ../../uaclient/messages/__init__.py:2007 +#: ../../uaclient/messages/__init__.py:2014 #, python-brace-format msgid "Unable to install Livepatch client: {error_msg}" msgstr "" -#: ../../uaclient/messages/__init__.py:2012 +#: ../../uaclient/messages/__init__.py:2019 #, python-brace-format msgid "\"{proxy}\" is not working. Not setting as proxy." msgstr "" -#: ../../uaclient/messages/__init__.py:2017 +#: ../../uaclient/messages/__init__.py:2024 #, python-brace-format msgid "\"{proxy}\" is not a valid url. Not setting as proxy." msgstr "" -#: ../../uaclient/messages/__init__.py:2023 +#: ../../uaclient/messages/__init__.py:2030 msgid "" "To use an HTTPS proxy for HTTPS connections, please install pycurl with `apt " "install python3-pycurl`" msgstr "" -#: ../../uaclient/messages/__init__.py:2029 +#: ../../uaclient/messages/__init__.py:2036 #, python-brace-format msgid "PycURL Error: {e}" msgstr "" -#: ../../uaclient/messages/__init__.py:2033 +#: ../../uaclient/messages/__init__.py:2040 msgid "Proxy authentication failed" msgstr "" -#: ../../uaclient/messages/__init__.py:2039 +#: ../../uaclient/messages/__init__.py:2046 msgid "" "Failed to connect to authentication server\n" "Check your Internet connection and try again." msgstr "" -#: ../../uaclient/messages/__init__.py:2046 +#: ../../uaclient/messages/__init__.py:2053 #, python-brace-format msgid "Error connecting to {url}: {code} {body}" msgstr "" -#: ../../uaclient/messages/__init__.py:2052 +#: ../../uaclient/messages/__init__.py:2059 #, python-brace-format msgid "" "Cannot {operation} unknown service '{invalid_service}'.\n" "{service_msg}" msgstr "" -#: ../../uaclient/messages/__init__.py:2061 +#: ../../uaclient/messages/__init__.py:2068 #, python-brace-format msgid "" "This machine is already attached to '{account_name}'\n" "To use a different subscription first run: sudo pro detach." msgstr "" -#: ../../uaclient/messages/__init__.py:2068 +#: ../../uaclient/messages/__init__.py:2075 #, python-brace-format msgid "Failed to attach machine. See {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:2075 +#: ../../uaclient/messages/__init__.py:2082 #, python-brace-format msgid "" "Error while reading {config_name}:\n" "{error}" msgstr "" -#: ../../uaclient/messages/__init__.py:2080 +#: ../../uaclient/messages/__init__.py:2087 #, python-brace-format msgid "Invalid token. See {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:2086 +#: ../../uaclient/messages/__init__.py:2093 #, python-brace-format msgid "" "Attach denied:\n" @@ -2707,7 +2717,7 @@ msgid "" "Visit {url} to manage contract tokens." msgstr "" -#: ../../uaclient/messages/__init__.py:2096 +#: ../../uaclient/messages/__init__.py:2103 #, python-brace-format msgid "" "Attach denied:\n" @@ -2715,7 +2725,7 @@ msgid "" "Visit {url} to manage contract tokens." msgstr "" -#: ../../uaclient/messages/__init__.py:2106 +#: ../../uaclient/messages/__init__.py:2113 #, python-brace-format msgid "" "Attach denied:\n" @@ -2723,41 +2733,41 @@ msgid "" "Visit {url} to manage contract tokens." msgstr "" -#: ../../uaclient/messages/__init__.py:2116 +#: ../../uaclient/messages/__init__.py:2123 #, python-brace-format msgid "Expired token or contract. To obtain a new token visit: {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:2123 +#: ../../uaclient/messages/__init__.py:2130 msgid "The magic attach token is already activated." msgstr "" -#: ../../uaclient/messages/__init__.py:2129 +#: ../../uaclient/messages/__init__.py:2136 msgid "The magic attach token is invalid, has expired or never existed" msgstr "" -#: ../../uaclient/messages/__init__.py:2135 +#: ../../uaclient/messages/__init__.py:2142 msgid "Service unavailable, please try again later." msgstr "" -#: ../../uaclient/messages/__init__.py:2140 +#: ../../uaclient/messages/__init__.py:2147 #, python-brace-format msgid "This attach flow does not support {param} with value: {value}" msgstr "" -#: ../../uaclient/messages/__init__.py:2146 +#: ../../uaclient/messages/__init__.py:2153 #, python-brace-format msgid "Ubuntu Pro server provided no aptURL directive for {entitlement_name}" msgstr "" -#: ../../uaclient/messages/__init__.py:2154 +#: ../../uaclient/messages/__init__.py:2161 #, python-brace-format msgid "" "This machine is not attached to an Ubuntu Pro subscription.\n" "See {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:2163 +#: ../../uaclient/messages/__init__.py:2170 #, python-brace-format msgid "" "To use '{{valid_service}}' you need an Ubuntu Pro subscription\n" @@ -2765,59 +2775,59 @@ msgid "" "See {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:2179 +#: ../../uaclient/messages/__init__.py:2186 #, python-brace-format msgid "could not find entitlement named \"{entitlement_name}\"" msgstr "" -#: ../../uaclient/messages/__init__.py:2184 +#: ../../uaclient/messages/__init__.py:2191 msgid "failed to enable some services" msgstr "" -#: ../../uaclient/messages/__init__.py:2190 +#: ../../uaclient/messages/__init__.py:2197 msgid "Failed to enable default services, check: sudo pro status" msgstr "" -#: ../../uaclient/messages/__init__.py:2198 +#: ../../uaclient/messages/__init__.py:2205 msgid "Something went wrong during the attach process. Check the logs." msgstr "" -#: ../../uaclient/messages/__init__.py:2206 +#: ../../uaclient/messages/__init__.py:2213 #, python-brace-format msgid "Ubuntu Pro server provided no aptKey directive for {entitlement_name}" msgstr "" -#: ../../uaclient/messages/__init__.py:2213 +#: ../../uaclient/messages/__init__.py:2220 #, python-brace-format msgid "Ubuntu Pro server provided no suites directive for {entitlement_name}" msgstr "" -#: ../../uaclient/messages/__init__.py:2220 +#: ../../uaclient/messages/__init__.py:2227 #, python-brace-format msgid "" "Cannot setup apt pin. Empty apt repo origin value for {entitlement_name}" msgstr "" -#: ../../uaclient/messages/__init__.py:2229 +#: ../../uaclient/messages/__init__.py:2236 #, python-brace-format msgid "Could not determine contract delta service type {orig} {new}" msgstr "" -#: ../../uaclient/messages/__init__.py:2233 +#: ../../uaclient/messages/__init__.py:2240 #, python-brace-format msgid "" "Error on Pro Image:\n" "{error_msg}" msgstr "" -#: ../../uaclient/messages/__init__.py:2239 +#: ../../uaclient/messages/__init__.py:2246 #, python-brace-format msgid "" "An error occurred while talking the the cloud metadata service: {code} - " "{body}" msgstr "" -#: ../../uaclient/messages/__init__.py:2246 +#: ../../uaclient/messages/__init__.py:2253 #, python-brace-format msgid "" "Failed to attach machine\n" @@ -2825,41 +2835,41 @@ msgid "" "For more information, see {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:2256 +#: ../../uaclient/messages/__init__.py:2263 #, python-brace-format msgid "No valid AWS IMDS endpoint discovered at addresses: {addresses}" msgstr "" -#: ../../uaclient/messages/__init__.py:2263 +#: ../../uaclient/messages/__init__.py:2270 msgid "Unable to determine cloud platform." msgstr "" -#: ../../uaclient/messages/__init__.py:2271 +#: ../../uaclient/messages/__init__.py:2278 #, python-brace-format msgid "" "Auto-attach image support is not available on this image\n" "See: {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:2280 +#: ../../uaclient/messages/__init__.py:2287 #, python-brace-format msgid "" "Auto-attach image support is not available on {{cloud_type}}\n" "See: {url}" msgstr "" -#: ../../uaclient/messages/__init__.py:2288 +#: ../../uaclient/messages/__init__.py:2295 #, python-brace-format msgid "{file_name} is not valid {file_format}" msgstr "" -#: ../../uaclient/messages/__init__.py:2294 +#: ../../uaclient/messages/__init__.py:2301 #, python-brace-format msgid "" "Could not parse /etc/os-release VERSION: {orig_ver} (modified to {mod_ver})" msgstr "" -#: ../../uaclient/messages/__init__.py:2302 +#: ../../uaclient/messages/__init__.py:2309 #, python-brace-format msgid "" "Could not extract series information from /etc/os-release.\n" @@ -2867,7 +2877,7 @@ msgid "" "and the VERSION_CODENAME information is not present" msgstr "" -#: ../../uaclient/messages/__init__.py:2312 +#: ../../uaclient/messages/__init__.py:2319 #, python-brace-format msgid "" "There is a corrupted lock file in the system. To continue, please remove it\n" @@ -2876,189 +2886,189 @@ msgid "" "$ sudo rm {lock_file_path}" msgstr "" -#: ../../uaclient/messages/__init__.py:2321 +#: ../../uaclient/messages/__init__.py:2328 #, python-brace-format msgid "{source} returned invalid json: {out}" msgstr "" -#: ../../uaclient/messages/__init__.py:2327 +#: ../../uaclient/messages/__init__.py:2334 #, python-brace-format msgid "" "Invalid value for {path_to_value} in /etc/ubuntu-advantage/uaclient.conf. " "Expected {expected_value}, found {value}." msgstr "" -#: ../../uaclient/messages/__init__.py:2336 +#: ../../uaclient/messages/__init__.py:2343 #, python-brace-format msgid "" "Cannot set {key} to {value}: for interval must be a positive integer." msgstr "" -#: ../../uaclient/messages/__init__.py:2343 +#: ../../uaclient/messages/__init__.py:2350 #, python-brace-format msgid "Invalid url in config. {key}: {value}" msgstr "" -#: ../../uaclient/messages/__init__.py:2348 +#: ../../uaclient/messages/__init__.py:2355 #, python-brace-format msgid "Could not find yaml file: {filepath}" msgstr "" -#: ../../uaclient/messages/__init__.py:2354 +#: ../../uaclient/messages/__init__.py:2361 msgid "" "Error: Setting global apt proxy and pro scoped apt proxy\n" "at the same time is unsupported.\n" "Cancelling config process operation.\n" msgstr "" -#: ../../uaclient/messages/__init__.py:2364 +#: ../../uaclient/messages/__init__.py:2371 msgid "Can't load the distro-info database." msgstr "" -#: ../../uaclient/messages/__init__.py:2369 +#: ../../uaclient/messages/__init__.py:2376 #, python-brace-format msgid "Can't find series {series} in the distro-info database." msgstr "" -#: ../../uaclient/messages/__init__.py:2374 +#: ../../uaclient/messages/__init__.py:2381 #, python-brace-format msgid "Error: Cannot use {option1} together with {option2}." msgstr "" -#: ../../uaclient/messages/__init__.py:2378 +#: ../../uaclient/messages/__init__.py:2385 #, python-brace-format msgid "No help available for '{name}'" msgstr "" -#: ../../uaclient/messages/__init__.py:2384 +#: ../../uaclient/messages/__init__.py:2391 #, python-brace-format msgid "" "Error: issue \"{issue}\" is not recognized.\n" "Usage: \"pro fix CVE-yyyy-nnnn\" or \"pro fix USN-nnnn\"" msgstr "" -#: ../../uaclient/messages/__init__.py:2390 +#: ../../uaclient/messages/__init__.py:2397 #, python-brace-format msgid "{arg} must be one of: {choices}" msgstr "" -#: ../../uaclient/messages/__init__.py:2395 +#: ../../uaclient/messages/__init__.py:2402 #, python-brace-format msgid "Expected {expected} but found: {actual}" msgstr "" -#: ../../uaclient/messages/__init__.py:2399 +#: ../../uaclient/messages/__init__.py:2406 msgid "Unable to process uaclient.conf" msgstr "" -#: ../../uaclient/messages/__init__.py:2404 +#: ../../uaclient/messages/__init__.py:2411 msgid "Unable to refresh your subscription" msgstr "" -#: ../../uaclient/messages/__init__.py:2409 +#: ../../uaclient/messages/__init__.py:2416 msgid "Unable to update Ubuntu Pro related APT and MOTD messages." msgstr "" -#: ../../uaclient/messages/__init__.py:2415 +#: ../../uaclient/messages/__init__.py:2422 msgid "json formatted response requires --assume-yes flag." msgstr "" -#: ../../uaclient/messages/__init__.py:2423 +#: ../../uaclient/messages/__init__.py:2430 msgid "" "Do not pass the TOKEN arg if you are using --attach-config.\n" "Include the token in the attach-config file instead.\n" " " msgstr "" -#: ../../uaclient/messages/__init__.py:2432 +#: ../../uaclient/messages/__init__.py:2439 msgid "Cannot provide both --args and --data at the same time" msgstr "" -#: ../../uaclient/messages/__init__.py:2438 +#: ../../uaclient/messages/__init__.py:2445 #, python-brace-format msgid "Unable to perform: {lock_request}.\n" msgstr "" -#: ../../uaclient/messages/__init__.py:2447 +#: ../../uaclient/messages/__init__.py:2454 msgid "This command must be run as root (try using sudo)." msgstr "" -#: ../../uaclient/messages/__init__.py:2452 +#: ../../uaclient/messages/__init__.py:2459 #, python-brace-format msgid "Metadata for {issue} is invalid. Error: {error_msg}." msgstr "" -#: ../../uaclient/messages/__init__.py:2459 +#: ../../uaclient/messages/__init__.py:2466 #, python-brace-format msgid "Error: {issue_id} not found." msgstr "" -#: ../../uaclient/messages/__init__.py:2463 +#: ../../uaclient/messages/__init__.py:2470 #, python-brace-format msgid "GPG key '{keyfile}' not found." msgstr "" -#: ../../uaclient/messages/__init__.py:2468 +#: ../../uaclient/messages/__init__.py:2475 #, python-brace-format msgid "'{endpoint}' is not a valid endpoint" msgstr "" -#: ../../uaclient/messages/__init__.py:2473 +#: ../../uaclient/messages/__init__.py:2480 #, python-brace-format msgid "Missing argument '{arg}' for endpoint {endpoint}" msgstr "" -#: ../../uaclient/messages/__init__.py:2478 +#: ../../uaclient/messages/__init__.py:2485 #, python-brace-format msgid "{endpoint} accepts no arguments" msgstr "" -#: ../../uaclient/messages/__init__.py:2483 +#: ../../uaclient/messages/__init__.py:2490 #, python-brace-format msgid "" "Error parsing API json data parameter:\n" "{data}" msgstr "" -#: ../../uaclient/messages/__init__.py:2488 +#: ../../uaclient/messages/__init__.py:2495 #, python-brace-format msgid "'{arg}' is not formatted as 'key=value'" msgstr "" -#: ../../uaclient/messages/__init__.py:2493 +#: ../../uaclient/messages/__init__.py:2500 #, python-brace-format msgid "Unable to determine version: {error_msg}" msgstr "" -#: ../../uaclient/messages/__init__.py:2498 +#: ../../uaclient/messages/__init__.py:2505 msgid "features.disable_auto_attach set in config" msgstr "" -#: ../../uaclient/messages/__init__.py:2503 +#: ../../uaclient/messages/__init__.py:2510 #, python-brace-format msgid "Unable to determine unattended-upgrades status: {error_msg}" msgstr "" -#: ../../uaclient/messages/__init__.py:2509 +#: ../../uaclient/messages/__init__.py:2516 #, python-brace-format msgid "Expected value with type {expected_type} but got type: {got_type}" msgstr "" -#: ../../uaclient/messages/__init__.py:2515 +#: ../../uaclient/messages/__init__.py:2522 #, python-brace-format msgid "" "Got value with incorrect type at index {index}:\n" "{nested_msg}" msgstr "" -#: ../../uaclient/messages/__init__.py:2521 +#: ../../uaclient/messages/__init__.py:2528 #, python-brace-format msgid "" "Got value with incorrect type for field \"{key}\":\n" "{nested_msg}" msgstr "" -#: ../../uaclient/messages/__init__.py:2528 +#: ../../uaclient/messages/__init__.py:2535 #, python-brace-format msgid "Value provided was not found in {enum_class}'s allowed: value: {values}" msgstr "" diff --git a/features/enable_fips_pro.feature b/features/enable_fips_pro.feature index 91edf7399d..7c96f1ed22 100644 --- a/features/enable_fips_pro.feature +++ b/features/enable_fips_pro.feature @@ -18,8 +18,12 @@ Feature: FIPS enablement in PRO cloud based machines fips-updates +yes +disabled +FIPS compliant crypto packages with stable security updates """ When I run `pro enable --assume-yes` with sudo - Then stdout contains substring: + Then stdout matches regexp: """ + This will downgrade the kernel from .+ to .+\. + Warning: Downgrading the kernel may cause hardware failures. Please ensure the + hardware is compatible with the new kernel version before proceeding. + Updating package lists Installing packages Updating standard Ubuntu package lists @@ -75,8 +79,12 @@ Feature: FIPS enablement in PRO cloud based machines fips-updates +yes +disabled +FIPS compliant crypto packages with stable security updates """ When I run `pro enable --assume-yes` with sudo - Then stdout contains substring: + Then stdout matches regexp: """ + This will downgrade the kernel from .+ to .+\. + Warning: Downgrading the kernel may cause hardware failures. Please ensure the + hardware is compatible with the new kernel version before proceeding. + Updating package lists Installing packages Updating standard Ubuntu package lists @@ -114,7 +122,6 @@ Feature: FIPS enablement in PRO cloud based machines | focal | azure.pro | FIPS | fips |https://esm.ubuntu.com/fips/ubuntu focal/main | | focal | azure.pro | FIPS Updates | fips-updates |https://esm.ubuntu.com/fips/ubuntu focal/main | - @slow Scenario Outline: Attached enable of FIPS in an ubuntu GCP PRO vm Given a `` `` machine with ubuntu-advantage-tools installed @@ -133,13 +140,16 @@ Feature: FIPS enablement in PRO cloud based machines fips-updates +yes +disabled +FIPS compliant crypto packages with stable security updates """ When I run `pro enable --assume-yes` with sudo - Then stdout contains substring: + Then stdout matches regexp: """ - Updating package lists + This will downgrade the kernel from .+ to .+\. + Warning: Downgrading the kernel may cause hardware failures. Please ensure the + hardware is compatible with the new kernel version before proceeding. + Installing packages Updating standard Ubuntu package lists enabled - A reboot is required to complete install. + A reboot is required to complete install\. """ When I run `pro status --all` with sudo Then stdout matches regexp: diff --git a/types-requirements.txt b/types-requirements.txt index 05629c955d..7502065d5f 100644 --- a/types-requirements.txt +++ b/types-requirements.txt @@ -2,3 +2,4 @@ mypy types-PyYAML types-toml types-pycurl +types-setuptools diff --git a/uaclient/apt.py b/uaclient/apt.py index fdf7fb82e2..049f037636 100644 --- a/uaclient/apt.py +++ b/uaclient/apt.py @@ -246,6 +246,18 @@ def get_apt_cache_policy( ) +def get_apt_cache_policy_for_package( + package: str, + error_msg: Optional[str] = None, + override_env_vars: Optional[Dict[str, str]] = None, +) -> str: + return run_apt_command( + cmd=["apt-cache", "policy", package], + error_msg=error_msg, + override_env_vars=override_env_vars, + ) + + class PreserveAptCfg: def __init__(self, apt_func): self.apt_func = apt_func diff --git a/uaclient/entitlements/fips.py b/uaclient/entitlements/fips.py index 425d2cd0c0..4bdc4887b9 100644 --- a/uaclient/entitlements/fips.py +++ b/uaclient/entitlements/fips.py @@ -1,7 +1,10 @@ import logging import os +import re from itertools import groupby -from typing import List, Optional, Tuple # noqa: F401 +from typing import Callable, List, Optional, Tuple, Union # noqa: F401 + +import pkg_resources from uaclient import apt, event_logger, exceptions, messages, system, util from uaclient.clouds.identity import NoCloudTypeReason, get_cloud_type @@ -167,6 +170,46 @@ def install_packages( :param cleanup_on_failure: Cleanup apt files if apt install fails. :param verbose: If true, print messages to stdout """ + + # Prior to installing packages, check if the kernel is being downgraded + # and if so verify that the user wants to continue + our_full_kernel_str = ( + system.get_kernel_info().proc_version_signature_version + ) + if our_full_kernel_str is None: + LOG.warning("Cannot gather kernel information") + return + our_m = re.search( + r"(?P\d+\.\d+\.\d+)", our_full_kernel_str + ) + fips_kernel_policy = apt.get_apt_cache_policy_for_package("linux-fips") + fips_m = re.search( + r"Candidate: (?P\d+\.\d+\.\d+)", fips_kernel_policy + ) + if fips_m is not None and our_m is not None: + our_kernel_version_str = our_m.group("kernel_version") + fips_kernel_version_str = fips_m.group("kernel_version") + our_version = pkg_resources.parse_version(our_kernel_version_str) + fips_version = pkg_resources.parse_version(fips_kernel_version_str) + if fips_version < our_version: + event.info( + messages.KERNEL_DOWNGRADE_WARNING.format( + current_version=our_kernel_version_str, + new_version=fips_kernel_version_str, + ) + ) + if not util.prompt_for_confirmation( + msg=messages.PROMPT_YES_NO, + assume_yes=self.assume_yes, + ): + return + else: + LOG.warning( + "Cannot gather kernel information for {cur} and {fips}".format( + cur=our_full_kernel_str, fips=fips_kernel_policy + ) + ) + if verbose: event.info( messages.INSTALLING_SERVICE_PACKAGES.format(title=self.title) diff --git a/uaclient/entitlements/tests/test_fips.py b/uaclient/entitlements/tests/test_fips.py index d27d5a78b3..6f9347d91a 100644 --- a/uaclient/entitlements/tests/test_fips.py +++ b/uaclient/entitlements/tests/test_fips.py @@ -405,6 +405,12 @@ def test_enable_configures_apt_sources_and_auth_files( retry_sleeps=apt.APT_RETRIES, override_env_vars=None, ), + mock.call( + ["apt-cache", "policy", "linux-fips"], + capture=True, + retry_sleeps=apt.APT_RETRIES, + override_env_vars=None, + ), ] subp_calls += install_cmd @@ -1104,7 +1110,6 @@ def test_install_packages_dont_fail_if_conditional_pkgs_not_installed( fips_entitlement_factory, event, ): - conditional_pkgs = ["b", "c"] m_installed_pkgs.return_value = conditional_pkgs packages = ["a"] diff --git a/uaclient/messages/__init__.py b/uaclient/messages/__init__.py index 3b1e9ce1be..8c1b6f957c 100644 --- a/uaclient/messages/__init__.py +++ b/uaclient/messages/__init__.py @@ -1300,6 +1300,13 @@ class TxtColor: ) + PROMPT_YES_NO ) +KERNEL_DOWNGRADE_WARNING = t.gettext( + """\ +This will downgrade the kernel from {current_version} to {new_version}. +Warning: Downgrading the kernel may cause hardware failures. Please ensure the + hardware is compatible with the new kernel version before proceeding. +""" +) FIPS_SYSTEM_REBOOT_REQUIRED = t.gettext( "FIPS support requires system reboot to complete configuration." )