You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/05/04 17:30:54 UTC

[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5807: t3c/torequest: syncds only checks if packages exist, doesn't try to fix them

rob05c commented on a change in pull request #5807:
URL: https://github.com/apache/trafficcontrol/pull/5807#discussion_r625972391



##########
File path: traffic_ops_ort/t3c/torequest/torequest.go
##########
@@ -1281,83 +1281,103 @@ func (r *TrafficOpsReq) ProcessPackages() error {
 		// check if the full package version is installed
 		fullPackage := pkgs[ii].Name + "-" + pkgs[ii].Version
 
-		if instpkg == fullPackage {
-			log.Infof("%s Currently installed and not marked for removal\n", reqpkg)
-			r.pkgs[fullPackage] = true
-			continue
-		} else if instpkg != "" { // the installed package needs upgrading.
-			log.Infof("%s Currently installed and marked for removal\n", instpkg)
-			uninstall = append(uninstall, instpkg)
-			// the required package needs installing.
-			log.Infof("%s is Not installed and is marked for installation.\n", fullPackage)
-			install = append(install, fullPackage)
-			// get a list of packages that depend on this one and mark dependencies
-			// for deletion.
-			arr, err = util.PackageInfo("pkg-requires", instpkg)
-			if err != nil {
-				return err
-			}
-			if len(arr) > 0 {
-				for jj := range arr {
-					log.Infof("%s is Currently installed and depends on %s and needs to be removed.", arr[jj], instpkg)
-					uninstall = append(uninstall, arr[jj])
+		if r.Cfg.RunMode == config.BadAss {
+			if instpkg == fullPackage {
+				log.Infof("%s Currently installed and not marked for removal\n", reqpkg)
+				r.pkgs[fullPackage] = true
+				continue
+			} else if instpkg != "" { // the installed package needs upgrading.
+				log.Infof("%s Currently installed and marked for removal\n", instpkg)
+				uninstall = append(uninstall, instpkg)
+				// the required package needs installing.
+				log.Infof("%s is Not installed and is marked for installation.\n", fullPackage)
+				install = append(install, fullPackage)
+				// get a list of packages that depend on this one and mark dependencies
+				// for deletion.
+				arr, err = util.PackageInfo("pkg-requires", instpkg)
+				if err != nil {
+					return err
 				}
+				if len(arr) > 0 {
+					for jj := range arr {
+						log.Infof("%s is Currently installed and depends on %s and needs to be removed.", arr[jj], instpkg)
+						uninstall = append(uninstall, arr[jj])
+					}
+				}
+			} else {
+				// the required package needs installing.
+				log.Infof("%s is Not installed and is marked for installation.\n", fullPackage)
+				log.Errorf("%s is Not installed and is marked for installation.\n", fullPackage)
+				install = append(install, fullPackage)
+			}
+		} else if r.Cfg.RunMode == config.SyncDS {
+			// Only check if packages exist and complain if they are wrong.
+			if instpkg == fullPackage {
+				log.Infof("%s Currently installed.\n", reqpkg)
+				r.pkgs[fullPackage] = true
+				continue
+			} else if instpkg != "" { // the installed package needs upgrading.
+				log.Infof("%s Wrong version currently installed.\n", instpkg)
+				log.Errorf("%s Wrong version currently installed.\n", instpkg)

Review comment:
       Nitpick: if this is an Error, doesn't need to also be an Info.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org