Skip to content

Commit 5dd6e49

Browse files
authored
improve code of racadm supportassist (#130)
* improve code of racadm supportassist * Updated according to the reviews
1 parent 32dfb11 commit 5dd6e49

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

pkg/setup-hw/dell.go

+17-3
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,25 @@ func (dc *dellConfigurator) configiDRAC(ctx context.Context) error {
495495
}
496496

497497
func (dc *dellConfigurator) acceptEULA(ctx context.Context) error {
498-
_, err := racadm(ctx, "supportassist", "accepteula")
499-
if strings.HasPrefix(err.Error(), "ERROR: SRV095") {
498+
/*
499+
If we have already accepted EULA, we will get the following message:
500+
SRV074: The SupportAssist End User License Agreement (EULA)is accepted by iDRAC user root
501+
via iDRAC interface RACADM
502+
*/
503+
out, err := racadm(ctx, "supportassist", "geteulastatus")
504+
if err != nil {
505+
return fmt.Errorf("failed to get status EULA by racadm command: %w", err)
506+
}
507+
if strings.Contains(out, "SRV074:") {
508+
// already accepted
500509
return nil
501510
}
502-
return err
511+
512+
_, err = racadm(ctx, "supportassist", "accepteula")
513+
if err != nil {
514+
return fmt.Errorf("failed to accept EULA by racadm command: %w", err)
515+
}
516+
return nil
503517
}
504518

505519
func (dc *dellConfigurator) configSNMP(ctx context.Context) error {

0 commit comments

Comments
 (0)