-
Notifications
You must be signed in to change notification settings - Fork 213
Added support for RHEL based systems where /etc/issue is modified #234
Conversation
@dapatil Thanks for the contribution! Do you have an AMI or some more detailed example that demonstrates the issue that this patch resolves? Pardon my ignorance but I don't normally use EL based distros. |
The following example should be sufficient. [root@nyci-claedwa01 ~]# cat /etc/issue ############################################################################ # # # Company Name System Login (C) 2013 Company Name # # # # This is a Company Name proprietary system. No use is allowed without # # proper authorization. Unauthorized use of this computer or network # # resources may constitute a breach of Company Name policy and be # # liable to prosecution under relevant legislation. Your use of Company # # Name electronic communication facilities is permitted only in # # accordance with company policies, is not private and is subject to # # auditing / monitoring at any time. # # # ############################################################################ [root@nyci-claedwa01 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.3 (Santiago) |
Yes, you're right. /etc/issue is often displayed when a user logs in and thus customized by many service providers. We can not rely on it having the original distro information. This is second case in short period of time (see #223). Maybe we should default to |
Definitely seen a fair number of systems that do this. Sounds like a good On Thursday, April 25, 2013, Darshan Patil wrote:
-Mat about.me/matschaffer |
If you're worried about too many ssh connections, we could change it to. def issue
cmds = [
"lsb_release -d -s",
"cat /etc/redhat-release",
"cat /etc/debian_version",
"cat /etc/issue"
]
prepare.run_command(cmds.join(" || ")).stdout.strip
end |
Yep, except /etc/debian_version only includes the version number without the "Debian..." prefix so a bit more logic is needed. But if you want to update the PR according to your suggestion (dropping the debian_version for now if you prefer), would be great. We should at least test that the current integration test suite passes. |
done |
I'd also rather if we reused the existing ssh connection than trying to be I have (yet another) long lived branch that has most of that refactor On Thursday, April 25, 2013, Teemu Matilainen wrote:
-Mat about.me/matschaffer |
Mat, so do you want the commands to be separated? |
I prefer what's in 9de6492 rather than the latest. I'd rather not -Mat about.me/matschaffer On Fri, May 3, 2013 at 2:46 PM, Teemu Matilainen
|
Ack. I would still like to prefer My proposal is here. Feeling lazy for making another PR. =) |
Nice. I think we could use a helper function though. Maybe something like run_with_fallbacks? e.g.,
And wrap the success checks in there? |
Yeah, I was thinking something like |
Thanks Darshan! This is now fixed in master. |
Thanks. |
Modified issue() so that it looks at /etc/redhat-release first.
This was tested on RHEL, Oracle Linux and Ubuntu.