Conversation
https://bugzilla.suse.com/show_bug.cgi?id=1073237#c4 & 5 When creating OSDs, it waits for for get_osd_id to return a value which caused ugly error messages in the logs: cat: /var/lib/ceph/osd/ceph-7/var/lib/ceph/tmp/mnt.lAtztf/whoami: No such file or directory
| def get_osd_id(device) | ||
| osd_path = %x[mount | grep #{device} | awk '{print $3}'].tr("\n","") | ||
| osd_id = %x[cat #{osd_path}/whoami].tr("\n","") | ||
| osd_id = %x[cat #{osd_path}/whoami 2>/dev/null].tr("\n","") |
There was a problem hiding this comment.
Style/CommandLiteral: Use backticks around command string. (https://github.com/bbatsov/ruby-style-guide#percent-x)
Style/PercentLiteralDelimiters: %x-literals should be delimited by ( and ). (https://github.com/bbatsov/ruby-style-guide#percent-literal-braces)
Layout/SpaceAfterComma: Space missing after comma. (https://github.com/bbatsov/ruby-style-guide#spaces-operators)
|
Shouldn't we add a check for that file presence? |
|
what would be the advantage? cat already checks for presence... |
|
Just thought it might be nicer and more readable, but probably is not really needed |
nicolasbock
left a comment
There was a problem hiding this comment.
It's definitely compact @bmwiedemann 😉. I still don't quite understand how stderr ends up in the log file.
https://bugzilla.suse.com/show_bug.cgi?id=1073237#c4 & 5
When creating OSDs, it waits for for get_osd_id to return a value
which caused ugly error messages in the logs:
cat: /var/lib/ceph/osd/ceph-7/var/lib/ceph/tmp/mnt.lAtztf/whoami: No such file or directory