Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to display logs when postinstall fails #728

Conversation

Projects
None yet
2 participants
@decentral1se
Copy link
Contributor

commented May 23, 2019

The problem

on failed postinstall, yunohost suggest to uses "yunohost log" but it's can't be used since postinstall hasn't run

See YunoHost/issues#1345.

Solution

Make a special case inside bin/yunohost to allow log display command to run.

Closes YunoHost/issues#1345.

PR Status

Ready for review.

How to test

root@yunohostdev:/ynh-dev/yunohost# yunohost
Error: YunoHost is not or not correctly installed. Please execute 'yunohost tools postinstall'
root@yunohostdev:/ynh-dev/yunohost# yunohost log display
usage: yunohost log display path [-h] [-n NUMBER] [--share]
yunohost log display: error: too few arguments
root@yunohostdev:/ynh-dev/yunohost# git diff
diff --git a/bin/yunohost b/bin/yunohost
index fd9c2dbf..10a21a9d 100755
--- a/bin/yunohost
+++ b/bin/yunohost
@@ -195,7 +195,8 @@ if __name__ == '__main__':
     # Check that YunoHost is installed
     if not os.path.isfile('/etc/yunohost/installed') and \
        (len(args) < 2 or (args[0] +' '+ args[1] != 'tools postinstall' and \
-                          args[0] +' '+ args[1] != 'backup restore')):
+                          args[0] +' '+ args[1] != 'backup restore' and \
+                          args[0] +' '+ args[1] != 'log display')):
 
         from moulinette import m18n
         # Init i18n
root@yunohostdev:/ynh-dev/yunohost# git checkout .
root@yunohostdev:/ynh-dev/yunohost# yunohost log display
Error: YunoHost is not or not correctly installed. Please execute 'yunohost tools postinstall'
root@yunohostdev:/ynh-dev/yunohost# touch /etc/yunohost/installed
root@yunohostdev:/ynh-dev/yunohost# yunohost log display
usage: yunohost log display path [-h] [-n NUMBER] [--share]
yunohost log display: error: too few arguments

Validation

  • Principle agreement 0/2 :
  • Quick review 0/1 :
  • Simple test 0/1 :
  • Deep review 0/1 :
@decentral1se

This comment has been minimized.

Copy link
Contributor Author

commented May 27, 2019

Bump 🦈 🦈 🦈

@alexAubin alexAubin added this to the 3.6.x milestone May 28, 2019

@alexAubin alexAubin merged commit 0c6d61c into YunoHost:stretch-unstable May 31, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.