11-08-2020 06:23 PM
Tried several variation to perform the equivalent of cli command - "devices device xxxx connect" -
root.devices.device[dev].connect.request()
root.devices.device[dev].connect()
and then check the 'result' attribute of object returned. However, I keep getting a timeout when doing this in python (even though the cli command to the same device returns true).
<ERR> 8-Nov-2020::21:15:23.622 nsov5-dev-01 ncs[197669]: devel-c service_pre_modification(create) error {external_timeout, ""} for callpoint.........
PS - I know that I should not be doing any external task in a service create (premod or otherwise), but am now curious to know why this is not working.
11-09-2020 01:38 AM
Works for me
10:24 $ ncs_pycli
Your maagic object 'root -> (root)' is now prepared... go have some fun!
trans.compare() to see your current transaction
trans.apply() to commit
trans.revert() to revert changes
Maapi object can be found at m
You can restart the transaction and create a fresh root object by invoking new_trans:
In [1]: new_trans
new transaction created
In [27]: output = root.devices.device['CE0'].connect()
In [28]: output.info
Out[28]: '(admin) Connected to CE0 - 127.0.0.1:10022'
In [29]: output.result
Out[29]: True
11-12-2020 07:23 PM
Thanks - Yes there was nothing wrong in the way I was composing the command in python - I made the mistake of a transaction in a transaction and created a lock condition so the clall never actually got resolved - hence the timeout. Thanks for the reply confirming the syntax. Much appreciated.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide