diff --git a/pyomo/solvers/plugins/solvers/gurobi_direct.py b/pyomo/solvers/plugins/solvers/gurobi_direct.py index 6d8a9137aa2..ab8176446ea 100644 --- a/pyomo/solvers/plugins/solvers/gurobi_direct.py +++ b/pyomo/solvers/plugins/solvers/gurobi_direct.py @@ -240,9 +240,9 @@ def _apply_solver(self): StaleFlagManager.mark_all_as_stale() if self._tee: - self._solver_model.setParam('OutputFlag', 1) + self._solver_model.setParam('LogToConsole', 1) else: - self._solver_model.setParam('OutputFlag', 0) + self._solver_model.setParam('LogToConsole', 0) if self._keepfiles: # Only save log file when the user wants to keep it. diff --git a/pyomo/solvers/tests/checks/test_gurobi_direct.py b/pyomo/solvers/tests/checks/test_gurobi_direct.py index d3fbef9d6d0..5320b04c732 100644 --- a/pyomo/solvers/tests/checks/test_gurobi_direct.py +++ b/pyomo/solvers/tests/checks/test_gurobi_direct.py @@ -134,9 +134,9 @@ def setParam(self, param, value): opt.solve(self.model, options={"MIPFocus": 2}) # Method should not be set again, but MIPFocus was changed. - # OutputFlag is explicitly set on the model. + # LogToConsole is explicitly set on the model. assert envparams == {"Method": 2, "MIPFocus": 1} - assert modelparams == {"MIPFocus": 2, "OutputFlag": 0} + assert modelparams == {"MIPFocus": 2, "LogToConsole": 0} # Try an erroneous parameter setting to ensure parameters go through in all # cases. Expect an error to indicate pyomo tried to set the parameter.