[Bug 1386275] Re: failure with utopic level lsblk. should use --output, not --out.

Scott Moser smoser at ubuntu.com
Mon Oct 27 18:09:35 UTC 2014


** Description changed:

+ === Begin SRU Information ===
+ [Impact]
+ curtin install if util-linux is at utopic version or later.
+ 
+ The problem is that curtin's '_lsblock' which is used to get invoke lsblock to
+ get information about the block devices of the system used '--out=' to specify
+ the output format rather than '--output'.  In utopic the version of util-linux
+ contains a lsblock with '--output-all' flag, which made '--output' ambiguous
+ and the command would fail.
+ 
+ The fix is then straight forward and is to just use '--output=' rather than
+ '--out='.  I'm not sure where the usage of '--out' came from as versions
+ of util-linux back to 12.04 support '--output'.
+ 
+ [Test Case]
+ $ sudo apt-get update -qy && apt-get install -qy python-curtin
+ $ dpkg-query --show python-curtin util-linux
+ python-curtin   0.1.0~bzr190-0ubuntu1
+ util-linux      2.25.1-3ubuntu4
+ $ python -c 'from curtin import block; import pprint; pprint.pprint(block._lsblock())'
+ 
+ Result currently is stack trace on utopic.
+ Success is a pretty printed dictionary of 'lsblk' information like:
+ {
+  'vdb1': {'ALIGNMENT': '0',
+           'DISC-ALN': '0',
+           'DISC-GRAN': '0',
+  ..
+           'UUID': '',
+           'device_path': '/dev/vdb1'}}
+ }
+ 
+ === End   SRU Information ===
+ 
  $ dpkg-query --show curtin python-curtin  util-linux
  curtin  0.1.0~bzr190-0ubuntu1
  python-curtin   0.1.0~bzr190-0ubuntu1
  util-linux      2.25.1-3ubuntu4
  
  $ sudo curtin --showtrace install http://cloud-
  images.ubuntu.com/utopic/current/utopic-server-cloudimg-
  amd64-root.tar.gz
  
  Traceback (most recent call last):
-   File "/usr/lib/python2.7/dist-packages/curtin/commands/main.py", line 96, in main
-     sys.exit(args.func(args))
-   File "/usr/lib/python2.7/dist-packages/curtin/commands/block_meta.py", line 53, in block_meta
-     meta_simple(args)
-   File "/usr/lib/python2.7/dist-packages/curtin/commands/block_meta.py", line 150, in meta_simple
-     devices = block.get_installable_blockdevs()
-   File "/usr/lib/python2.7/dist-packages/curtin/block/__init__.py", line 118, in get_installable_blockdevs
-     unused = get_unused_blockdev_info()
-   File "/usr/lib/python2.7/dist-packages/curtin/block/__init__.py", line 81, in get_unused_blockdev_info
-     bdinfo = _lsblock(['--nodeps'])
-   File "/usr/lib/python2.7/dist-packages/curtin/block/__init__.py", line 70, in _lsblock
-     (out, _err) = util.subp(basecmd + list(args), capture=True)
-   File "/usr/lib/python2.7/dist-packages/curtin/util.py", line 67, in subp
-     cmd=args)
+   File "/usr/lib/python2.7/dist-packages/curtin/commands/main.py", line 96, in main
+     sys.exit(args.func(args))
+   File "/usr/lib/python2.7/dist-packages/curtin/commands/block_meta.py", line 53, in block_meta
+     meta_simple(args)
+   File "/usr/lib/python2.7/dist-packages/curtin/commands/block_meta.py", line 150, in meta_simple
+     devices = block.get_installable_blockdevs()
+   File "/usr/lib/python2.7/dist-packages/curtin/block/__init__.py", line 118, in get_installable_blockdevs
+     unused = get_unused_blockdev_info()
+   File "/usr/lib/python2.7/dist-packages/curtin/block/__init__.py", line 81, in get_unused_blockdev_info
+     bdinfo = _lsblock(['--nodeps'])
+   File "/usr/lib/python2.7/dist-packages/curtin/block/__init__.py", line 70, in _lsblock
+     (out, _err) = util.subp(basecmd + list(args), capture=True)
+   File "/usr/lib/python2.7/dist-packages/curtin/util.py", line 67, in subp
+     cmd=args)
  ProcessExecutionError: Unexpected error while running command.
  Command: ['lsblk', '--noheadings', '--bytes', '--pairs', '--out=ALIGNMENT,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO,FSTYPE,GROUP,KNAME,LABEL,LOG-SEC,MAJ:MIN,MIN-IO,MODE,MODEL,MOUNTPOINT,NAME,OPT-IO,OWNER,PHY-SEC,RM,RO,ROTA,RQ-SIZE,SIZE,STATE,TYPE,UUID', '--nodeps']
  Exit code: 1
  ...
  is ambiguous; possibilities: \'--output\' \'--output-all\'\n\nUsage:\n lsblk [options] [<device> ...]\n\nOptions:\n -a, --all
  
- 
  basically, util-linux's lsblk gained a '--output-all' argument, which made our use of '--out' ambiguous.  Note, back to 12.04 supports --output per http://manpages.ubuntu.com/manpages/precise/en/man8/lsblk.8.html .
  not sure why I used '--out'.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to curtin in Ubuntu.
https://bugs.launchpad.net/bugs/1386275

Title:
  failure with utopic level lsblk. should use --output, not --out.

To manage notifications about this bug go to:
https://bugs.launchpad.net/curtin/+bug/1386275/+subscriptions



More information about the Ubuntu-server-bugs mailing list