Skip to content

Commit

Permalink
auto-attach: make error message clearer
Browse files Browse the repository at this point in the history
When a machine tries to auto-attach and the contract server returns an
error, print hints on what could have happened together with the error
details.

Signed-off-by: Renan Rodrigo <[email protected]>
  • Loading branch information
renanrodrigo committed Mar 18, 2024
1 parent 636ea94 commit 0755ff3
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 104 deletions.
104 changes: 53 additions & 51 deletions debian/po/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-14 11:22-0400\n"
"POT-Creation-Date: 2024-03-18 10:45-0300\n"
"PO-Revision-Date: 2023-09-25 12:29-0400\n"
"Last-Translator: Lucas Moura <[email protected]>\n"
"Language-Team: Brazilian Portuguese <[email protected]."
Expand Down Expand Up @@ -3185,38 +3185,40 @@ msgstr ""
msgid "Could not determine contract delta service type {orig} {new}"
msgstr ""

#: ../../uaclient/messages/__init__.py:2268
#: ../../uaclient/messages/__init__.py:2270
#, python-brace-format
msgid ""
"Error on Pro Image:\n"
"Failed to identify this image as a valid Ubuntu Pro image.\n"
"Maybe not Pro, upgrade to Pro failed, or server is not responding.\n"
"Details:\n"
"{error_msg}"
msgstr ""

#: ../../uaclient/messages/__init__.py:2274
#: ../../uaclient/messages/__init__.py:2281
#, python-brace-format
msgid ""
"An error occurred while talking the the cloud metadata service: {code} - "
"{body}"
msgstr ""

#: ../../uaclient/messages/__init__.py:2281
#: ../../uaclient/messages/__init__.py:2288
#, python-brace-format
msgid ""
"Failed to attach machine\n"
"{{status_code}}: {{error_msg}}\n"
"For more information, see {url}"
msgstr ""

#: ../../uaclient/messages/__init__.py:2291
#: ../../uaclient/messages/__init__.py:2298
#, python-brace-format
msgid "No valid AWS IMDS endpoint discovered at addresses: {addresses}"
msgstr ""

#: ../../uaclient/messages/__init__.py:2298
#: ../../uaclient/messages/__init__.py:2305
msgid "Unable to determine cloud platform."
msgstr ""

#: ../../uaclient/messages/__init__.py:2306
#: ../../uaclient/messages/__init__.py:2313
#, python-brace-format
msgid ""
"Auto-attach image support is not available on this image\n"
Expand All @@ -3225,7 +3227,7 @@ msgstr ""
"Suporte para auto-attach não está disponível para esta imagem\n"
"Veja {url}"

#: ../../uaclient/messages/__init__.py:2315
#: ../../uaclient/messages/__init__.py:2322
#, python-brace-format
msgid ""
"Auto-attach image support is not available on {{cloud_type}}\n"
Expand All @@ -3234,18 +3236,18 @@ msgstr ""
"Suporte para auto-attach não está disponível para {{cloud_type}}\n"
"Veja: {url}"

#: ../../uaclient/messages/__init__.py:2323
#: ../../uaclient/messages/__init__.py:2330
#, python-brace-format
msgid "{file_name} is not valid {file_format}"
msgstr ""

#: ../../uaclient/messages/__init__.py:2329
#: ../../uaclient/messages/__init__.py:2336
#, python-brace-format
msgid ""
"Could not parse /etc/os-release VERSION: {orig_ver} (modified to {mod_ver})"
msgstr ""

#: ../../uaclient/messages/__init__.py:2337
#: ../../uaclient/messages/__init__.py:2344
#, python-brace-format
msgid ""
"Could not extract series information from /etc/os-release.\n"
Expand All @@ -3256,7 +3258,7 @@ msgstr ""
"o campo VERSION não tem a informação de versão: {version}\n"
"e o campo VERSION_CODENAME não está presente"

#: ../../uaclient/messages/__init__.py:2347
#: ../../uaclient/messages/__init__.py:2354
#, python-brace-format
msgid ""
"There is a corrupted lock file in the system. To continue, please remove it\n"
Expand All @@ -3270,12 +3272,12 @@ msgstr ""
"\n"
"$ sudo rm {lock_file_path}"

#: ../../uaclient/messages/__init__.py:2356
#: ../../uaclient/messages/__init__.py:2363
#, python-brace-format
msgid "{source} returned invalid json: {out}"
msgstr "{source} retornou um json inválido: {out}"

#: ../../uaclient/messages/__init__.py:2362
#: ../../uaclient/messages/__init__.py:2369
#, python-brace-format
msgid ""
"Invalid value for {path_to_value} in /etc/ubuntu-advantage/uaclient.conf. "
Expand All @@ -3284,25 +3286,25 @@ msgstr ""
"Valor inválido para {path_to_value} em /etc/ubuntu-advantage/uaclient.conf."
"Esperava {expected_value}, mas {value} foi encontrado."

#: ../../uaclient/messages/__init__.py:2371
#: ../../uaclient/messages/__init__.py:2378
#, python-brace-format
msgid ""
"Cannot set {key} to {value}: <value> for interval must be a positive integer."
msgstr ""
"Não foi possível associar {key} a {value}: <value> precisa ser um inteiro "
"positivo."

#: ../../uaclient/messages/__init__.py:2378
#: ../../uaclient/messages/__init__.py:2385
#, 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:2383
#: ../../uaclient/messages/__init__.py:2390
#, 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:2389
#: ../../uaclient/messages/__init__.py:2396
msgid ""
"Error: Setting global apt proxy and pro scoped apt proxy\n"
"at the same time is unsupported.\n"
Expand All @@ -3313,27 +3315,27 @@ msgstr ""
"pro de apt ao mesmo tempo não é suportado.\n"
"Cancelando o processo de configuração.\n"

#: ../../uaclient/messages/__init__.py:2399
#: ../../uaclient/messages/__init__.py:2406
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:2404
#: ../../uaclient/messages/__init__.py:2411
#, 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:2409
#: ../../uaclient/messages/__init__.py:2416
#, 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:2413
#: ../../uaclient/messages/__init__.py:2420
#, python-brace-format
msgid "No help available for '{name}'"
msgstr "Ajuda não disponível para '{name}'"

#: ../../uaclient/messages/__init__.py:2419
#: ../../uaclient/messages/__init__.py:2426
#, python-brace-format
msgid ""
"Error: issue \"{issue}\" is not recognized.\n"
Expand All @@ -3342,34 +3344,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:2425
#: ../../uaclient/messages/__init__.py:2432
#, python-brace-format
msgid "{arg} must be one of: {choices}"
msgstr "{arg} precisa ser um de: {choices}"

#: ../../uaclient/messages/__init__.py:2430
#: ../../uaclient/messages/__init__.py:2437
#, python-brace-format
msgid "Expected {expected} but found: {actual}"
msgstr "Esperava {expected} mas encontrou: {actual}"

#: ../../uaclient/messages/__init__.py:2434
#: ../../uaclient/messages/__init__.py:2441
msgid "Unable to process uaclient.conf"
msgstr "Falha ao processar uaclient.conf"

#: ../../uaclient/messages/__init__.py:2439
#: ../../uaclient/messages/__init__.py:2446
msgid "Unable to refresh your subscription"
msgstr "Falha ao atualizar sua assinatura"

#: ../../uaclient/messages/__init__.py:2444
#: ../../uaclient/messages/__init__.py:2451
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:2450
#: ../../uaclient/messages/__init__.py:2457
msgid "json formatted response requires --assume-yes flag."
msgstr "resposta formatada em json necessita do paramêtro --assume-yes"

#: ../../uaclient/messages/__init__.py:2458
#: ../../uaclient/messages/__init__.py:2465
msgid ""
"Do not pass the TOKEN arg if you are using --attach-config.\n"
"Include the token in the attach-config file instead.\n"
Expand All @@ -3379,50 +3381,50 @@ msgstr ""
"Ao invés disso, inclua o token no arquivo de attach-config.\n"
" "

#: ../../uaclient/messages/__init__.py:2467
#: ../../uaclient/messages/__init__.py:2474
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:2473
#: ../../uaclient/messages/__init__.py:2480
#, python-brace-format
msgid "Unable to perform: {lock_request}.\n"
msgstr "Falha ao executar: {lock_request}.\n"

#: ../../uaclient/messages/__init__.py:2482
#: ../../uaclient/messages/__init__.py:2489
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:2487
#: ../../uaclient/messages/__init__.py:2494
#, 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:2494
#: ../../uaclient/messages/__init__.py:2501
#, python-brace-format
msgid "Error: {issue_id} not found."
msgstr "Erro: {issue_id} não encontrada."

#: ../../uaclient/messages/__init__.py:2498
#: ../../uaclient/messages/__init__.py:2505
#, python-brace-format
msgid "GPG key '{keyfile}' not found."
msgstr "chave GPG '{keyfile}' não foi encontrada"

#: ../../uaclient/messages/__init__.py:2503
#: ../../uaclient/messages/__init__.py:2510
#, python-brace-format
msgid "'{endpoint}' is not a valid endpoint"
msgstr "'{endpoint}' não é um endpoint válido"

#: ../../uaclient/messages/__init__.py:2508
#: ../../uaclient/messages/__init__.py:2515
#, python-brace-format
msgid "Missing argument '{arg}' for endpoint {endpoint}"
msgstr "'{arg}' está faltando para endpoint {endpoint}"

#: ../../uaclient/messages/__init__.py:2513
#: ../../uaclient/messages/__init__.py:2520
#, python-brace-format
msgid "{endpoint} accepts no arguments"
msgstr "{endpoint} não aceita paramêtros"

#: ../../uaclient/messages/__init__.py:2518
#: ../../uaclient/messages/__init__.py:2525
#, python-brace-format
msgid ""
"Error parsing API json data parameter:\n"
Expand All @@ -3431,32 +3433,32 @@ msgstr ""
"Error ao analisar paramêtro data para API json:\n"
"{data}"

#: ../../uaclient/messages/__init__.py:2523
#: ../../uaclient/messages/__init__.py:2530
#, python-brace-format
msgid "'{arg}' is not formatted as 'key=value'"
msgstr "'{arg}' não está formatado como 'chave=valor'"

#: ../../uaclient/messages/__init__.py:2528
#: ../../uaclient/messages/__init__.py:2535
#, 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:2533
#: ../../uaclient/messages/__init__.py:2540
msgid "features.disable_auto_attach set in config"
msgstr "features.disable_auto_attach definida na configuração"

#: ../../uaclient/messages/__init__.py:2538
#: ../../uaclient/messages/__init__.py:2545
#, 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:2544
#: ../../uaclient/messages/__init__.py:2551
#, 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:2550
#: ../../uaclient/messages/__init__.py:2557
#, python-brace-format
msgid ""
"Got value with incorrect type at index {index}:\n"
Expand All @@ -3465,7 +3467,7 @@ msgstr ""
"Valor com tipo incorreto na posição {index}:\n"
"{nested_msg}"

#: ../../uaclient/messages/__init__.py:2556
#: ../../uaclient/messages/__init__.py:2563
#, python-brace-format
msgid ""
"Got value with incorrect type for field \"{key}\":\n"
Expand All @@ -3474,19 +3476,19 @@ msgstr ""
"Valor com tipo incorreto para o campo \"{key}\":\n"
"{nested_msg}"

#: ../../uaclient/messages/__init__.py:2563
#: ../../uaclient/messages/__init__.py:2570
#, python-brace-format
msgid "Value provided was not found in {enum_class}'s allowed: value: {values}"
msgstr ""
"Valor fornecido não está presente nos valores permitidos de {enum_class}: "
"{values}"

#: ../../uaclient/messages/__init__.py:2574
#: ../../uaclient/messages/__init__.py:2581
#, python-brace-format
msgid "Error updating ESM services cache: {error}"
msgstr ""

#: ../../uaclient/messages/__init__.py:2580
#: ../../uaclient/messages/__init__.py:2587
#, python-brace-format
msgid ""
"There is a problem with the resource directives provided by {url}\n"
Expand Down
Loading

0 comments on commit 0755ff3

Please sign in to comment.