MobaXterm 10.64.17.44nso-Antel-Lab 20220721 130329
MobaXterm 10.64.17.44nso-Antel-Lab 20220721 130329
MobaXterm 10.64.17.44nso-Antel-Lab 20220721 130329
44's password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v21.5 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to root@10.64.17.44
│
│ • Direct SSH : v
│
│ • SSH compression : v
│
│ • SSH-browser : v
│
│ • X11-forwarding : x (disabled or not supported by server)
│
│
│
│ → For more info, ctrl+click on help or visit our website.
│
└──────────────────────────────────────────────────────────────────────┘
class HSIyaConfigurado(BaseException):
pass
def checkHSIonONU(onu):
for servicio in onu.services:
if (servicio.service_type != None) and ('HSI' in
servicio.service_type):
raise HSIyaConfigurado
class ServiceCallbacks(Service):
@Service.create
def cb_create(self, tctx, root, service, proplist):
self.log.info('Service create(service=', service._path, ')')
template = ncs.template.Template(service)
vars = ncs.template.Variables()
try:
vars.add('service_path', service._path)
for onu in service.onus:
olt = root.services.pon.infraestructure.olts[onu.olt]
olt_type =
root.services.pon.infraestructure.olt_types[olt.vendor, olt.model,
olt.software_version]
config_onu =
root.services.pon.infraestructure.onus[onu.olt, onu.rack, onu.shelf, onu.slot,
onu.port, onu.onuid
]
checkHSIonONU(config_onu)
#onu_type =
root.services.pon.infraestructure.onus[onu.olt, onu.rack, onu.shelf, onu.slot,
onu.port, onu.onuid]
.onu_type
vars.add('olt', onu.olt)
vars.add('olt-type', olt_type.model)
vars.add('rack', onu.rack)
vars.add('shelf', onu.shelf)
vars.add('slot', onu.slot)
vars.add('port', onu.port)
vars.add('onuid', onu.onuid)
vars.add('portid', onu.onuid*10+0+120)
#vars.add('onu_type', onu_type)
vars.add('onu_type', config_onu.onu_type)
vars.add('slot_type', config_onu.slot_type)
vars.add('downstream',
onu.traffic_profile.downstream)
vars.add('upstream', onu.traffic_profile.upstream)
vars.add('service_type', onu.service_type)
vars.add('wifi_mesh', onu.wifi_mesh)
vars.add('device', onu.olt)
self.log.info(vars)
template.apply('pon-hsi-template', vars)
except HSIyaConfigurado:
raise Exception("La ONU ya tiene un servicio HSI
configurado")
class Main(ncs.application.Application):
def setup(self):
self.log.info('Main RUNNING')
self.register_service('pon-hsi', ServiceCallbacks)
def teardown(self):
self.log.info('Main FINISHED')
[root@logicalis1 hsi]#
[root@logicalis1 hsi]#
[root@logicalis1 hsi]#
[root@logicalis1 hsi]#
[root@logicalis1 hsi]# cd ..
[root@logicalis1 python]# cd ..
[root@logicalis1 pon-hsi]# cd templates/
[root@logicalis1 templates]# ll
total 32
-rwxr-xr-x. 1 root root 32408 Apr 21 18:03 pon-hsi-template.xml
[root@logicalis1 templates]# more pon-hsi-template.xml
<config xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device tags="nocreate">
<name>{$device}</name>
<config tags="merge">