Skip to content

Commit

Permalink
Merge pull request #691 from open-amt-cloud-toolkit/fix-ccm
Browse files Browse the repository at this point in the history
fix: activates in ccm mode now
  • Loading branch information
madhavilosetty-intel authored Nov 14, 2024
2 parents c4ea176 + 7e58423 commit 47664d1
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions internal/flags/activate.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (f *Flags) ValidateConfigV2() error {
f.UseCCM = true
default:
log.Error("Invalid Control Mode")
return utils.IncorrectCommandLineParameters //ToDo: Add a new error type
return utils.IncorrectCommandLineParameters
}

// Check if the AMT Password is set
Expand All @@ -169,19 +169,20 @@ func (f *Flags) ValidateConfigV2() error {
f.LocalConfig.ACMSettings.AMTPassword = f.LocalConfigV2.Configuration.AMTSpecific.AdminPassword
f.LocalConfig.Password = f.LocalConfigV2.Configuration.AMTSpecific.AdminPassword

// Check if the Provisioning Certificate is set
if f.LocalConfigV2.Configuration.AMTSpecific.ProvisioningCert == "" {
log.Error("Provisioning Certificate is not set")
return utils.IncorrectCommandLineParameters //ToDo: Add a new error type
}
f.LocalConfig.ACMSettings.ProvisioningCert = f.LocalConfigV2.Configuration.AMTSpecific.ProvisioningCert
if f.UseACM {
// Check if the Provisioning Certificate is set
if f.LocalConfigV2.Configuration.AMTSpecific.ProvisioningCert == "" {
log.Error("Provisioning Certificate is not set")
return utils.IncorrectCommandLineParameters
}
f.LocalConfig.ACMSettings.ProvisioningCert = f.LocalConfigV2.Configuration.AMTSpecific.ProvisioningCert

// Check if the Provisioning Certificate Password is set
if f.LocalConfigV2.Configuration.AMTSpecific.ProvisioningCertPwd == "" {
log.Error("Provisioning Certificate Password is not set")
return utils.IncorrectCommandLineParameters //ToDo: Add a new error type
// Check if the Provisioning Certificate Password is set
if f.LocalConfigV2.Configuration.AMTSpecific.ProvisioningCertPwd == "" {
log.Error("Provisioning Certificate Password is not set")
return utils.IncorrectCommandLineParameters
}
f.LocalConfig.ACMSettings.ProvisioningCertPwd = f.LocalConfigV2.Configuration.AMTSpecific.ProvisioningCertPwd
}
f.LocalConfig.ACMSettings.ProvisioningCertPwd = f.LocalConfigV2.Configuration.AMTSpecific.ProvisioningCertPwd

return nil
}

0 comments on commit 47664d1

Please sign in to comment.