示例#1
0
def get_deprecations():
    """Return a list of currently active deprecation notices."""
    deprecations = []

    def add_deprecation(id):
        deprecation = deepcopy(DEPRECATIONS[id])
        deprecation["id"] = id
        deprecation["url"] = DEPRECATION_URL.format(id=id)
        deprecations.append(deprecation)

    if snappy.running_in_snap() and snappy.get_snap_mode() == "all":
        add_deprecation("MD1")

    return deprecations
示例#2
0
def get_deprecations():
    """Return a list of currently active deprecation notices."""
    deprecations = []
    if snappy.running_in_snap() and snappy.get_snap_mode() == "all":
        deprecations.append(DEPRECATIONS["NO_ALL_MODE"])
    return deprecations
示例#3
0
 def test_get_snap_mode_mode_other(self):
     self._write_snap_mode("rack+region")
     self.assertEqual(snappy.get_snap_mode(), "rack+region")
示例#4
0
 def test_get_snap_mode_mode_none(self):
     self._write_snap_mode("none")
     self.assertIsNone(snappy.get_snap_mode())