-
Notifications
You must be signed in to change notification settings - Fork 90
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
Support for Brocade FOS-based SAN devices #254
Conversation
@marcelhuth This is awesome! If it is detected as Linux here https://github.com/chef/train/blob/master/lib/train/platforms/detect/specifications/os.rb#L329, you could add a check for brocade just before, therefore it will test brocade before jumping into generic linux. |
@chris-rock Thanks for your feedback. So the code currently work for the standard use case (normal user to login) at the moment. It gets complicated when using root (and there are people working with root on the devices, even though it's not supported/recommended). |
Looks good to me. Thanks for your work on this @marcelhuth! |
Hi @jquick , As @chris-rock stated the check could be moved just before "Generic Linux", but we only reach that code when using A second possibility is to throw an exception for "unsupported user in OS" (or something similar) when having the second check true. I would like to avoid the situation where somebody depends on the os.platform is "unix" and does anything that is supported there that breaks the brocade device when using Do you have any ideas on that? Thanks, |
Hi @jquick and @chris-rock |
This works but gets us into a position of having to support the downstream platforms by ignoring it. Instead I think you had the right idea of putting the bash version right above linux in its own family then redefine the family again at the bottom. I am submitting my own refactor for arista which has the same issue. Ill post here the section, when I post it. |
Hey @marcelhuth - take a look at the arista example: |
Hi @jquick - saw your PR already ;) As this is now in master, I'll get my stuff changed to fit to the new base os family layout. I'll refactor the bash vs. "normal" shell login in the way you did with Arista as well. I'll try to get that ready the next days. Thanks for helping. |
Signed-off-by: Marcel Huth <marcel.huth111@gmail.com>
Looks good to me! Thanks for your work on this @marcelhuth ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @marcelhuth Great addition!
Hi,
I made a few changes that makes train able to detect FOS (Fabric OS) of Brocade Fibre-Channel switches.
The whole thing has currently a problem (stated in the code as well): The OS of these devices is linux based and does respond to
uname
command correctly when logging in as root user. If you log in with root, train will detect Unix/Linux/Generic Linux what is not what we want here. If you log in with a different (normal) user, that user will get rbash shell as CLI anduname
command is not available what makes it possible to "fall through" the unix detection and detect a brocade_fos platform.Normally you won't log in using root user to those devices (vendor says it's not supported), nevertheless you could do this and it would break the detection.
One workaround would be to handle brocade detection before unix, but that would cause
version
command run on all systems (except windows). I guess this is not really an option. Unfortunately I have no idea how to get around this problem currently.Thanks for your feedback!