Skip to content
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

Merged
merged 3 commits into from
Feb 14, 2025
Merged

Add accept EULA in iDRAC #128

merged 3 commits into from
Feb 14, 2025

Conversation

takara9
Copy link
Contributor

@takara9 takara9 commented Feb 14, 2025

No description provided.

@takara9 takara9 self-assigned this Feb 14, 2025
@takara9 takara9 requested a review from YZ775 February 14, 2025 00:14
return nil
}

func (dc *dellConfigurator) acceptEULA(ctx context.Context) error {
_, err := racadmSetConfig(ctx, "supportassist", "accepteula")
Copy link
Contributor

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>

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

Copy link
Contributor Author

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.

@takara9 takara9 requested a review from YZ775 February 14, 2025 00:54
return nil
}

func (dc *dellConfigurator) acceptEULA(ctx context.Context) error {
_, err := racadm(ctx, "supportassist", "accepteula")
if strings.Contains(err.Error(),"SRV095") {
Copy link
Contributor

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")

Copy link
Contributor Author

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 takara9 requested a review from YZ775 February 14, 2025 01:18
@YZ775
Copy link
Contributor

YZ775 commented Feb 14, 2025

@takara9
I think the commit does not pushed yet. Could you check it?

@takara9
Copy link
Contributor Author

takara9 commented Feb 14, 2025

@YZ775
sorry, I get phone call sadunly.
now I push this PR.

Copy link
Contributor

@YZ775 YZ775 left a 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

@takara9 takara9 merged commit eaf4d05 into main Feb 14, 2025
1 check passed
@takara9 takara9 deleted the accept_eula branch February 14, 2025 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants