(Adds quote, background) By Nia Williams CALGARY, Alberta, March 4 (Reuters) - Canada will take whatever measures are needed to keep the Line 5 oil pipeline open, Natural Resources Minister Seamus O'Regan said on Thursday, as the deadline for a shutdown order from the U.S. state of Michigan looms. Michigan last November ordered pipeline owner Enbridge Inc to shut down Line 5, which ships 540,000 barrels a day of crude oil and propane from Canada, in May because of concerns the 68-year-old pipeline could leak into the Great Lakes. O'Regan's comments came after Michael Grant, assistant deputy minister for the Americas at the Canadian foreign ministry, said on Tuesday that Canada could turn to the Transit Pipelines Treaty of 1977, which provides for the unimpeded flow of petroleum products in pipelines linking the two nations. "We are preparing to invoke whatever measures we need to in order to make sure Line 5 remains operational," O'Regan told a parliamentary committee.