Bug 1442

Summary: make pyviz resilient to nedevice module import failures
Product: ns-3 Reporter: Alex Afanasyev <alexander.afanasyev>
Component: visualizerAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: CONFIRMED ---    
Severity: normal CC: ns-bugs, tomh
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: patch

Description Alex Afanasyev 2012-05-31 17:02:38 UTC
Recently introduces LTE module introduces small changes in visualizer.  
Somehow, ns3.lte module requires virtual_net_device module, which is not available on mac.

The attached patch solves the problem by handling exception during the import of ns3.lte.  Not sure if this should be a permanent solution.
Comment 1 Alex Afanasyev 2012-05-31 17:02:57 UTC
Created attachment 1409 [details]
patch
Comment 2 Tom Henderson 2012-06-01 00:53:49 UTC
changing the title as it is reproducible on Linux also.  

Would this be remedied by enabling bindings on the virtual-net-device module?
Comment 3 Tom Henderson 2012-06-01 14:44:38 UTC
Alex, can you pull the tip of ns-3-dev (changeset 07e2e440d667) and retest, and close this bug if it works for you?  I pushed some changes that fixed it for me on my Linux test machine, but my OS X test machine is not set up with the supporting packages for visualization.
Comment 4 Gustavo J. A. M. Carneiro 2012-06-01 15:37:49 UTC
Eek, sorry for lack of responsiveness.  I saw this bug report in my cell phone, but then forgot to re-check in the laptop.  Unfortunately I can't fix now, tomorrow morning probably...
Comment 5 Gustavo J. A. M. Carneiro 2012-06-02 06:56:27 UTC
It's true that ns3.lte module requires virtual_net_device, because the underlying lte C++ module uses virtual-net-device for some reason.

Adding python bindings to virtual_net_device is the right way to go, but complementary approach of letting pyviz gracefully handle python module import failures is also a good idea IMHO, even if Alex's patch to do so is not the most clean way to achieve it (bare except anti-idiom, see http://docs.python.org/howto/doanddont.html#except )
Comment 6 Gustavo J. A. M. Carneiro 2012-06-02 07:01:38 UTC
Anyway, if after tom added virtual-net-device bindings the visualizer works, we can close this and I can open a separate bug report "make pyviz resilient to nedevice module import failures".
Comment 7 Tom Henderson 2012-12-06 00:03:33 UTC
(In reply to comment #6)
> Anyway, if after tom added virtual-net-device bindings the visualizer works,
> we can close this and I can open a separate bug report "make pyviz resilient
> to nedevice module import failures".

I think the original symptoms are gone, but the question is whether to open the separate bug report as suggested above.  Gustavo?