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

Set the exit value when running cf-key #2903

Merged
merged 1 commit into from Nov 16, 2017
Merged

Set the exit value when running cf-key #2903

merged 1 commit into from Nov 16, 2017

Conversation

skreuzer
Copy link
Contributor

@skreuzer skreuzer commented Aug 5, 2017

When running cf-key to generate new keys, set the exit value of the
program to be 0 on success and 1 on failure. This makes it easier to
catch errors during setup of a new machine.

Change the default behavior of the program to not write anything to stdout,
opting to use the Log() function which can write to stdout and will also
allow output to be sent to syslog.

Add a --inform option to set the global log level to LOG_LEVEL_INFO.

Change the permissions of the randseed file to 600 and catch the exception
if the chmod call fails.

Copy link
Contributor

@jimis jimis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@jimis
Copy link
Contributor

jimis commented Sep 18, 2017

I like this. But I'm not sure about the change in behaviour: cf-key becomes silent by default, printing nothing on the console. @nickanderson what do you think?

The commit message needs a big "changelog" tag btw.

@jimis jimis self-assigned this Sep 20, 2017
@nickanderson
Copy link
Member

I don't see any issue with suppressing "Making a key pair for CFEngine, please wait, this could take a minute..." by default with cf-key.

+1 for exit code.

Not for currently released branches.

@nickanderson
Copy link
Member

@skreuzer can you ammend your commit to include the line:

Changelog: commit

@skreuzer
Copy link
Contributor Author

skreuzer commented Nov 2, 2017

@skreuzer can you ammend your commit to include the line:

I just amended the commit message with that line

When running cf-key to generate new keys, set the exit value of the
program to be 0 on success and 1 on failure. This makes it easier to
catch errors during setup of a new machine.

Change the default behavior of the program to not write anything to stdout,
opting to use the Log() function which can write to stdout and will also
allow output to be sent to syslog.

Add a --inform option to set the global log level to LOG_LEVEL_INFO.

Change the permissions of the randseed file to 600 and catch the exception
if the chmod call fails.

Changelog: commit
@jimis jimis merged commit d493044 into cfengine:master Nov 16, 2017
@jimis
Copy link
Contributor

jimis commented Nov 16, 2017

Merged, thanks!

I still think that LOG_LEVEL_NOTICE would be better for that single message "generating keys", because it might hang for a while. Anyway merged, we can always tweak it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants