Bug 3768 - smart: --yaml option doesn't work
Summary: smart: --yaml option doesn't work
Status: RESOLVED FIXED
Alias: None
Product: Package Management Issues
Classification: Runtime
Component: package-management-issues (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.4 M4
Assignee: Paul Eggleton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-01-22 07:45 UTC by Yi Zhao
Modified: 2013-02-16 19:23 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yi Zhao 2013-01-22 07:45:09 UTC
Image location: http://autobuilder.yoctoproject.org/pub/nightly/20130115-2/
Tree/Branch: poky/master
Git Rev: 9eb88ceb39b7d0b8ddc6487e61ce8edadef10ec4

Some smart commands have the --yaml option, but this option doesn't work.

##############
root@qemumips:~# smart channel --yaml
Traceback (most recent call last):
  File "/usr/bin/smart", line 200, in <module>
    main(sys.argv[1:])
  File "/usr/bin/smart", line 173, in main
    exitcode = iface.run(opts.command, opts.argv)
  File "/usr/lib/python2.7/site-packages/smart/interface.py", line 53, in run
    result = _command.main(self._ctrl, opts)
  File "/usr/lib/python2.7/site-packages/smart/commands/channel.py", line 342, in main
    import yaml
ImportError: No module named yaml
root@qemumips:~# 

root@qemumips:~# smart config --yaml
Traceback (most recent call last):
  File "/usr/bin/smart", line 200, in <module>
    main(sys.argv[1:])
  File "/usr/bin/smart", line 173, in main
    exitcode = iface.run(opts.command, opts.argv)
  File "/usr/lib/python2.7/site-packages/smart/interface.py", line 53, in run
    result = _command.main(self._ctrl, opts)
  File "/usr/lib/python2.7/site-packages/smart/commands/config.py", line 140, in main
    import yaml
ImportError: No module named yaml
root@qemumips:~# 

##############
Comment 1 Paul Eggleton 2013-01-22 08:55:34 UTC
This is simply because the yaml python module isn't installed. I wouldn't consider this core functionality, so the question is do we want to add a dependency just for the sake of enabling this option?
Comment 2 Paul Eggleton 2013-01-25 10:55:34 UTC
Changing to NEEDINFO, see my above comment
Comment 3 Mark Hatle 2013-01-25 17:31:20 UTC
yaml is a pretty common way of exporting information from an RPM repository.

We likely should package up the yaml python module.. and then add a test in smart to see if it is installed.

That way it works if the user needs it, but it's disabled (to save space) for the normal case.
Comment 4 Paul Eggleton 2013-01-25 17:42:16 UTC
Sounds like a sensible approach to me - thanks.
Comment 5 Paul Eggleton 2013-02-08 09:46:49 UTC
It turns out there's a python-pyyaml recipe in meta-oe, it just needed an update; I have sent a patch to update it and the libyaml recipe that is also there. I've also sent an OE-Core patch to ask the user to install PyYAML if it can't be imported instead of printing a python backtrace.
Comment 6 Paul Eggleton 2013-02-11 15:28:52 UTC
The OE-Core/Poky part of this patch is merged:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=0d85fa531b03f0e7b3ad3d2a5a4d92293b43b8ff

The meta-oe part is still pending.