-
Notifications
You must be signed in to change notification settings - Fork 1
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 accept EULA in iDRAC #128
Conversation
pkg/setup-hw/dell.go
Outdated
return nil | ||
} | ||
|
||
func (dc *dellConfigurator) acceptEULA(ctx context.Context) error { | ||
_, err := racadmSetConfig(ctx, "supportassist", "accepteula") |
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.
racadmSetConfig() is a function that sets configuration by executing racadm set <KEY> <VALUE>
Line 197 in 3895b5d
func racadmSetConfig(ctx context.Context, key, value string) (bool, error) { |
And it seems that there are no option to accept EULA by using racadm set <KEY> <VALUE>
$ racadm get iDRAC.SupportAssist
[Key=iDRAC.Embedded.1#SupportAssist.1]
DefaultIPAddress=
!!DefaultPassword=******** (Write-Only)
DefaultProtocol=CIFS
DefaultProtocolPort=0
DefaultShareName=
DefaultUserName=
DefaultWorkgroupName=
#EmailOptIn=Yes
#EventBasedAutoCollection=Disabled
#FilterAutoCollections=No
#HostOSProxyAddress=
#HostOSProxyConfigured=No
!!HostOSProxyPassword=******** (Write-Only)
#HostOSProxyPort=1
#HostOSProxyUserName=
#iDRACFirstPowerUpDateTime=Tue Dec 03 23:51:49 GMT 2024
#NativeOSLogsCollectionSupported=None
PreferredLanguage=English
#ProSupportPlusRecommendationsReport=Disabled
#RegistrationID=
#RequestTechnicianForPartsDispatch=No
#SupportAssistEnableState=Disabled
So we need to implement another way.
In addition, if EULA is already accepted, the command returns error, so we should have to take care of it.
$ racadm supportassist accepteula
ERROR: SRV095:The SupportAssist End User License Agreement (EULA) is already accepted by iDRAC user root
via iDRAC interface RACADM
$ echo $?
8
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.
@YZ775
Thank you for you appoint out my wrongs.
I have impoved my code, please review it.
pkg/setup-hw/dell.go
Outdated
return nil | ||
} | ||
|
||
func (dc *dellConfigurator) acceptEULA(ctx context.Context) error { | ||
_, err := racadm(ctx, "supportassist", "accepteula") | ||
if strings.Contains(err.Error(),"SRV095") { |
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.
using partial match is dangerous in some situations.
I think it would better to use HasPrefix.
strings.HasPrefix(err.Error(), "ERROR: SRV095")
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.
@YZ775
Thank you for your helpful recommendation.
I replaced by it. please review again.
@takara9 |
@YZ775 |
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 for the fix.
LGTM
No description provided.