2301e26797d0228d2ad3cc3506341b28b084e817
[osm/vim-emu.git] / src / emuvim / api / openstack / resources / router.py
1 import uuid
2
3
4 class Router:
5 def __init__(self, name, id=None):
6 self.name = name
7 self.id = id if id is not None else str(uuid.uuid4())
8 self.subnet_names = list()
9
10 def add_subnet(self, subnet_name):
11 self.subnet_names.append(subnet_name)
12
13 def __eq__(self, other):
14 if self.name == other.name and len(self.subnet_names) == len(other.subnet_names) and \
15 set(self.subnet_names) == set(other.subnet_names):
16 return True
17 return False