Skip to content

Correctly log error message when pkg-install fails#348

Open
jburianek wants to merge 1 commit intotruenas:masterfrom
jburianek:error-msg-truenas
Open

Correctly log error message when pkg-install fails#348
jburianek wants to merge 1 commit intotruenas:masterfrom
jburianek:error-msg-truenas

Conversation

@jburianek
Copy link

Original PR: iocage#1270


If pkg-install fails, we should ignore blank lines when attempting to send back a helpful error message to the user.

This is because e.message can look something like this:

[b"pkg: No packages available to install matching 'fake-package' have been found in the repositories\n", b'', b'', b'']

Which leads to a very unhelpful error message like this:

Installing plugin packages:
  - fake-package... 
    - fake-package failed to install, retry #1
    - fake-package failed to install, retry #2
    - fake-package failed to install, retry #3

pkg error:
  - fake-package :

After this change the message is propagated back to the user:

Installing plugin packages:
  - fake-package... 
    - fake-package failed to install, retry #1
    - fake-package failed to install, retry #2
    - fake-package failed to install, retry #3

pkg error:
  - fake-package :pkg: No packages available to install matching 'fake-package' have been found in the repositories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant