def _get_partitions(dev):
 dev_path = utils.make_dev_path(dev)
 (out, _err) = utils.execute('parted', '--script', '--machine', dev_path, 'unit s', 'print', run_as_root=True)
 lines = [line for line in out.split('\n') if line]
 partitions = []
 LOG.debug('Partitions:')
 for line in lines[2:]:
  line = line.rstrip(';')
  (num, start, end, size, fstype, name, flags) = line.split(':')
  num = int(num)
  start = int(start.rstrip('s'))
  end = int(end.rstrip('s'))
  size = int(size.rstrip('s'))
  LOG.debug('  %(num)s: %(fstype)s %(size)d sectors', {'num': num, 'fstype': fstype, 'size': size})
  partitions.append((num, start, size, fstype, name, flags))
 return partitions

def _get_partitions ( dev ) : dev_path = utils . make_dev_path ( dev ) ( out , _err ) = utils . execute ( 'parted' , '--script' , '--machine' , dev_path , 'unit s' , 'print' , run_as_root = True ) lines = [ line for line in out . split ( '\n' ) if line ] partitions = [ ] LOG . debug ( 'Partitions:' ) for line in lines [ 2 : ] : line = line . rstrip ( ';' ) ( num , start , end , size , fstype , name , flags ) = line . split ( ':' ) num = int ( num ) start = int ( start . rstrip ( 's' ) ) end = int ( end . rstrip ( 's' ) ) size = int ( size . rstrip ( 's' ) ) LOG . debug ( '  %(num)s: %(fstype)s %(size)d sectors' , { 'num' : num , 'fstype' : fstype , 'size' : size } ) partitions . append ( ( num , start , size , fstype , name , flags ) ) return partitions
return partition information for a device .