def create_device(self, name): vendor = "Default" addr = DeviceIP(name, name, False) return DeviceInfo( self.service, name, None, None, [addr], addr, self.service.vendors.get(vendor), "GEN", "Generic", )
def mock_dev(self, idx): addrs = [ 'fd01:db00:11:{:04x}::a'.format(idx), 'fd01:db00:11:{:04x}::b'.format(idx), '10.10.{}.11'.format(idx), '10.10.{}.12'.format(idx), ] addrs = [DeviceIP(a, a, False) for a in addrs] vendor_id = (idx // 5) + 1 vendor = 'vendor%d' % (vendor_id) return DeviceInfo(self.service, 'test-dev-%d' % (idx), test_user, test_pass, addrs, addrs[0], self.service.vendors.get(vendor), 'role%d' % (idx % 3), 'ch_model')
def create_device(self, container): vendor = 'docker' ip = container.attrs['NetworkSettings']['IPAddress'] addr = DeviceIP('addr', ip, False) return DeviceInfo( self.service, container.name, 'netbot', 'bot1234', [addr], addr, self.service.vendors.get(vendor), 'Demo', 'Ubuntu')
def create_device(self, container): vendor = "docker" ip = container.attrs["NetworkSettings"]["IPAddress"] addr = DeviceIP("addr", ip, False) return DeviceInfo( self.service, container.name, "netbot", "bot1234", [addr], addr, self.service.vendors.get(vendor), "Demo", "Ubuntu", )
def mock_dev(self, idx): addrs = [ "fd01:db00:11:{:04x}::a".format(idx), "fd01:db00:11:{:04x}::b".format(idx), "10.10.{}.11".format(idx), "10.10.{}.12".format(idx), ] addrs = [DeviceIP(a, a, False) for a in addrs] vendor_id = (idx // 5) + 1 vendor = "vendor%d" % (vendor_id) return DeviceInfo( self.service, "test-dev-%d" % (idx), test_user, test_pass, addrs, addrs[0], self.service.vendors.get(vendor), "role%d" % (idx % 3), "ch_model", )
def create_device(self, name): vendor = 'Default' addr = DeviceIP(name, name, False) return DeviceInfo(self.service, name, None, None, [addr], addr, self.service.vendors.get(vendor), 'GEN', 'Generic')