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

diagcfg: Allow diagcfg to create logging.config in data directory. #3912

Merged
merged 2 commits into from
Apr 27, 2022

Conversation

winder
Copy link
Contributor

@winder winder commented Apr 24, 2022

Summary

When running diagcfg as a user without a home directory, the missing global default directory prevents diagcfg from writing logging.config. With this change, the error is cleared out so that the file can be created as usual.

The only risk is if the global logging file was being used, and is for some reason temporarily inaccessible, those defaults would not be copied into the new file.

Test Plan

Manual testing.

Run diagcfg with ALGORAND_DATA and -d, the file is created in the data directory.
Run diagcfg without ALGORAND_DATA or -d, the file is created in the default global directory.

Also tested on a docker environment where the user did not have a home directory (or default global directory), the logging file is created in the data directory.

@winder winder changed the title Allow diagcfg to create logging.config in data directory. diagcfg: Allow diagcfg to create logging.config in data directory. Apr 24, 2022
@winder winder self-assigned this Apr 24, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2022

Codecov Report

Merging #3912 (9bd7afa) into master (452af1c) will increase coverage by 0.01%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #3912      +/-   ##
==========================================
+ Coverage   50.06%   50.07%   +0.01%     
==========================================
  Files         394      394              
  Lines       68471    68471              
==========================================
+ Hits        34279    34287       +8     
+ Misses      30491    30484       -7     
+ Partials     3701     3700       -1     
Impacted Files Coverage Δ
logging/telemetry.go 81.66% <50.00%> (ø)
data/transactions/verify/txn.go 44.15% <0.00%> (-0.87%) ⬇️
cmd/tealdbg/debugger.go 72.69% <0.00%> (-0.81%) ⬇️
ledger/acctupdates.go 68.51% <0.00%> (-0.27%) ⬇️
catchup/service.go 68.88% <0.00%> (ø)
network/wsPeer.go 68.61% <0.00%> (+0.55%) ⬆️
data/abi/abi_type.go 88.62% <0.00%> (+0.94%) ⬆️
catchup/peerSelector.go 100.00% <0.00%> (+1.04%) ⬆️
ledger/tracker.go 76.82% <0.00%> (+2.14%) ⬆️
ledger/roundlru.go 96.22% <0.00%> (+5.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 452af1c...9bd7afa. Read the comment docs.

@winder winder force-pushed the will/diagcfg-in-data branch from 9bd7afa to 0003c96 Compare April 24, 2022 16:36
@winder winder merged commit a653a76 into algorand:master Apr 27, 2022
@winder winder deleted the will/diagcfg-in-data branch April 27, 2022 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants