[ create a new paste ] login | about

Link: http://codepad.org/FyhgFr1Q    [ raw code | fork ]

Python, pasted on Apr 29:
1
2
3
4
5
6
7
8
9
10
11
def type_by_name(self, name):
        if name.startswith("eth"):
            return "physical"
        elif name.startswith("lo"):
            return "loopback"
        elif name.startswith("br"):
            return "aggregated"
        elif name.startswith("vtun"):
            return "tunnel"
        else:
            raise Exception("Cannot detect interface type for %s" % name)


Create a new paste based on this one


Comments: