-
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
Add openvms detection #159
Conversation
@@ -96,6 +98,8 @@ def detect_family | |||
# TODO: extend base implementation for detecting the family type | |||
# to Windows and others | |||
case uname_s | |||
when /unrecognized command verb/ |
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.
not sure if we can expect that every system that has not uname_s is openvms
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.
maybe we just don't set any family then
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.
problem is that if we omit this part, it matches
when /./
@platform[:family] = 'unix'
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.
Its a pain because the uname_s command doesnt returns an error that can be detected by the command object (old os) but a message that says : %DCL-W-IVVERB, unrecognized command verb - check validity and spelling
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.
I think we should create a method for detecting non-uname operating systems. Is there a reliable command that only works on openvms to detect the family?
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.
Okay, lets use this for now until we find any other non-uname
operating system
@@ -124,6 +129,7 @@ def detect_family_type # rubocop:disable Metrics/CyclomaticComplexity, Metrics/P | |||
# unix based systems combine the above | |||
return true if pf == 'unix' and detect_darwin | |||
return true if pf == 'unix' and detect_esx | |||
#This is assuming that pf is set to unix, this should be if pf == 'linux' |
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.
I think we can argue that arista should be in detect_linux
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.
@backend.run_command('show system/noprocess') will always return OpenVMS Vxx e.g. "OpenVMS V8.2 on node VS3B2 3-NOV-2016 21:41:10.97 Uptime 171 04:49:02
"
@@ -96,6 +98,8 @@ def detect_family | |||
# TODO: extend base implementation for detecting the family type | |||
# to Windows and others | |||
case uname_s | |||
when /unrecognized command verb/ |
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.
I think we should create a method for detecting non-uname operating systems. Is there a reliable command that only works on openvms to detect the family?
Could you please sign off your commits? Are you resolving the linting issues? |
Signed-off-by: Brian Doody <[email protected]>
…ie/train into add_openvms_detection Signed-off-by: Brian Doody <[email protected]>
e5e1178
to
4c1071e
Compare
Looking at the lint testing part now |
Signed-off-by: Brian Doody <[email protected]>
a Signed-off-by: Brian Doody <[email protected]>
…ie/train into add_openvms_detection Signed-off-by: Brian Doody <[email protected]> Conflicts: lib/train/extras/os_detect_openvms.rb
@chris-rock not sure on this final error. All the lint testing should pass now. |
awesome @briandoodyie I think we are getting very close... |
@@ -124,6 +129,7 @@ def detect_family_type # rubocop:disable Metrics/CyclomaticComplexity, Metrics/P | |||
# unix based systems combine the above | |||
return true if pf == 'unix' and detect_darwin | |||
return true if pf == 'unix' and detect_esx | |||
# This is assuming that pf is set to unix, this should be if pf == 'linux' |
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.
we should remove that command, since from trains perspective linux is a subset of a unix-like operating system.
@@ -96,6 +98,8 @@ def detect_family | |||
# TODO: extend base implementation for detecting the family type | |||
# to Windows and others | |||
case uname_s | |||
when /unrecognized command verb/ | |||
@platform[:family] = 'openvms' |
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.
Since we cannot expect that every non-uname system is openvms I would prefer to set it to nil here?
@@ -230,7 +230,7 @@ def to_s | |||
|
|||
class OS < OSCommon | |||
def initialize(backend) | |||
super(backend, { family: 'unix' }) |
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.
I just thinking if it is not easier to count openvms as a unix-like system as well? Not sure about that. This would allow us to just use
return true if pf =='unix' && detect_openvms
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.
This was the original code and the problem there is that
@briandoodyie Anything I can help with? |
Hmmm the ssh access will work and was the original change that was made. It made everything a lot simpler but doesnt windows now also support ssh. Might be assumption that just doesnt work now. thoughts? @chris-rock |
@briandoodyie I wanna clean this up as well, I just want to do this in two steps. I apologize for the confusion |
@briandoodyie I go with the current PR. Thanks @briandoodyie for putting all the effort into that |
This has been tested with OpenVMS 8.3.