Mailinglist Archive: yast-commit (322 mails)

< Previous Next >
[yast-commit] r57214 - in /trunk/storage/libstorage/bindings/python: example.py probing.py
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Sat, 16 May 2009 12:52:57 -0000
  • Message-id: <E1M5JNp-0000Rs-K2@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Sat May 16 14:52:57 2009
New Revision: 57214

URL: http://svn.opensuse.org/viewcvs/yast?rev=57214&view=rev
Log:
- renamed and extended probing example

Added:
trunk/storage/libstorage/bindings/python/probing.py (contents, props
changed)
- copied, changed from r57200,
trunk/storage/libstorage/bindings/python/example.py
Removed:
trunk/storage/libstorage/bindings/python/example.py

Copied: trunk/storage/libstorage/bindings/python/probing.py (from r57200,
trunk/storage/libstorage/bindings/python/example.py)
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/bindings/python/probing.py?p2=trunk/storage/libstorage/bindings/python/probing.py&p1=trunk/storage/libstorage/bindings/python/example.py&r1=57200&r2=57214&rev=57214&view=diff
==============================================================================
--- trunk/storage/libstorage/bindings/python/example.py (original)
+++ trunk/storage/libstorage/bindings/python/probing.py Sat May 16 14:52:57 2009
@@ -13,45 +13,50 @@

for container in containers:

- print container.device
+ print "Device:", container.device

if container.type == LibStorage.DISK:

diskinfo = LibStorage.DiskInfo()
c.getDiskInfo(container.name, diskinfo)
- print " ", diskinfo.sizeK
+ print " Size:", LibStorage.byteToHumanString(1024 * diskinfo.sizeK,
True, 2, False)
+ print " Cylinder Size:",
LibStorage.byteToHumanString(diskinfo.cylSize, True, 2, False)

partitioninfos = LibStorage.dequepartitioninfo()
c.getPartitionInfo(container.name, partitioninfos)

for partitioninfo in partitioninfos:
- print " ", partitioninfo.v.device, partitioninfo.v.sizeK, \
- partitioninfo.cylStart, partitioninfo.cylSize
+ print " Device:", partitioninfo.v.device
+ print " Size:", LibStorage.byteToHumanString(1024 *
partitioninfo.v.sizeK, True, 2, False)
+
+ if container.type == LibStorage.MD:
+
+ mdinfos = LibStorage.dequemdinfo()
+ c.getMdInfo(mdinfos)
+
+ for mdinfo in mdinfos:
+ print " Device:", mdinfo.v.device
+ print " Size:", LibStorage.byteToHumanString(1024 *
mdinfo.v.sizeK, True, 2, False)
+ print " Chunk Size:", LibStorage.byteToHumanString(1024 *
mdinfo.chunkSizeK, True, 2, True)

if container.type == LibStorage.LVM:

lvmvginfo = LibStorage.LvmVgInfo()
c.getLvmVgInfo(container.name, lvmvginfo)
- print " ", lvmvginfo.sizeK
+ print " Size:", LibStorage.byteToHumanString(1024 * lvmvginfo.sizeK,
True, 2, False)
+ print " PE Size:", LibStorage.byteToHumanString(1024 *
lvmvginfo.peSizeK, True, 2, True)

lvmlvinfos = LibStorage.dequelvmlvinfo()
c.getLvmLvInfo(container.name, lvmlvinfos)

for lvmlvinfo in lvmlvinfos:
- print " ", lvmlvinfo.v.device, lvmlvinfo.v.sizeK
-
-
-print
-
-
-fscapabilities = LibStorage.FsCapabilities()
-c.getFsCapabilities(LibStorage.EXT4, fscapabilities)
-print fscapabilities.isExtendable, fscapabilities.minimalFsSizeK, \
- fscapabilities.isExtendableWhileMounted
-
-print LibStorage.byteToHumanString(1234567890, True, 4, False)
+ print " Device:", lvmlvinfo.v.device
+ print " Size:", LibStorage.byteToHumanString(1024 *
lvmlvinfo.sizeK, True, 2, False)
+ print " Stripes:", lvmlvinfo.stripes
+ if lvmlvinfo.stripes > 1:
+ print " Stripe Size:", LibStorage.byteToHumanString(1024 *
lvmlvinfo.stripeSizeK, True, 2, True)

-print LibStorage.saveGraph(c, "storage.gv")
+ print


LibStorage.destroyStorageInterface(c)

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages