Beispiel #1
0
 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",
     )
Beispiel #2
0
 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')
Beispiel #3
0
 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')
Beispiel #4
0
 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",
     )
Beispiel #5
0
 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",
     )
Beispiel #6
0
 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')