forked from p15670423/monkey
37 lines
819 B
Python
37 lines
819 B
Python
|
from connectors import NetControllerConnector
|
||
|
|
||
|
demo_state = {
|
||
|
501: ["Machine A", "Machine B"],
|
||
|
502: ["Machine C",],
|
||
|
503: ["Machine D",],
|
||
|
514: ["Machine E", "Machine F"],
|
||
|
}
|
||
|
|
||
|
|
||
|
class DemoConnector(NetControllerConnector):
|
||
|
def __init__(self):
|
||
|
self._conn = None
|
||
|
self._properties = {
|
||
|
"address": "127.0.0.1",
|
||
|
"port": 0,
|
||
|
"username": "",
|
||
|
"password": "",
|
||
|
}
|
||
|
|
||
|
def connect(self):
|
||
|
self._conn = object()
|
||
|
|
||
|
def is_connected(self):
|
||
|
return not self._conn == None
|
||
|
|
||
|
def disconnect(self):
|
||
|
self._conn = None
|
||
|
|
||
|
def get_vlans_list(self):
|
||
|
return demo_state.keys()
|
||
|
|
||
|
def get_entities_on_vlan(self, vlanid):
|
||
|
if (demo_state.has_key(vlanid)):
|
||
|
return demo_state[vlanid]
|
||
|
return []
|