Remove syncuser warning messages in wwctl that assume its use

- #1321

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-02-11 17:13:06 -07:00
parent 21333482e6
commit f2092b2854
3 changed files with 9 additions and 11 deletions

View File

@@ -35,6 +35,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Removed partial support for regex searches in node and profile lists. #1635
- Remove redundant `wwctl genconfig completions` command. #1716
- Remove syncuser warning messages in `wwctl` that assume its use. #1321
## v4.6.0rc2, 2025-02-07

View File

@@ -130,9 +130,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
afterPasswdTime := getTime(path.Join(imagePath, "/etc/passwd"))
wwlog.Debug("passwdTime: %v", afterPasswdTime)
if beforePasswdTime.Before(afterPasswdTime) {
if !SyncUser {
wwlog.Warn("/etc/passwd has been modified, maybe you want to run syncuser")
}
userdbChanged = true
}
}
@@ -140,16 +137,16 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
afterGroupTime := getTime(path.Join(imagePath, "/etc/group"))
wwlog.Debug("groupTime: %v", afterGroupTime)
if beforeGroupTime.Before(afterGroupTime) {
if !SyncUser {
wwlog.Warn("/etc/group has been modified, maybe you want to run syncuser")
}
userdbChanged = true
}
}
if userdbChanged && SyncUser {
err = image.SyncUids(imageName, false)
if err != nil {
wwlog.Error("Error in user sync, fix error and run 'syncuser' manually: %s", err)
if SyncUser {
if userdbChanged {
if err = image.SyncUids(imageName, false); err != nil {
wwlog.Error("syncuser error: %s", err)
}
} else {
wwlog.Info("Skipping syncuser (passwd or group not changed)")
}
}

View File

@@ -195,7 +195,7 @@ func ImageImport(cip *wwapiv1.ImageImportParameter) (imageName string, err error
if cip.SyncUser {
err = image.SyncUids(cip.Name, true)
if err != nil {
err = fmt.Errorf("error in user sync, fix error and run 'syncuser' manually: %s", err)
err = fmt.Errorf("syncuser error: %w", err)
return
}
}