本文整理匯總了Python中virtinst.StoragePool.pool_list_from_sources方法的典型用法代碼示例。如果您正苦於以下問題:Python StoragePool.pool_list_from_sources方法的具體用法?Python StoragePool.pool_list_from_sources怎麽用?Python StoragePool.pool_list_from_sources使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類virtinst.StoragePool
的用法示例。
在下文中一共展示了StoragePool.pool_list_from_sources方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testEnumerateNetFS
# 需要導入模塊: from virtinst import StoragePool [as 別名]
# 或者: from virtinst.StoragePool import pool_list_from_sources [as 別名]
def testEnumerateNetFS(self):
name = "pool-netfs-list"
host = "example.com"
lst = StoragePool.pool_list_from_sources(self.conn,
StoragePool.TYPE_NETFS,
host=host)
self._enumerateCompare(name, lst)
示例2: list_pool_sources
# 需要導入模塊: from virtinst import StoragePool [as 別名]
# 或者: from virtinst.StoragePool import pool_list_from_sources [as 別名]
def list_pool_sources(self, host=None):
pool_type = self._pool.type
plist = []
try:
plist = StoragePool.pool_list_from_sources(
self.conn.get_backend(),
pool_type,
host=host)
except Exception:
logging.exception("Pool enumeration failed")
return plist
示例3: testEnumerateiSCSI
# 需要導入模塊: from virtinst import StoragePool [as 別名]
# 或者: from virtinst.StoragePool import pool_list_from_sources [as 別名]
def testEnumerateiSCSI(self):
host = "example.com"
lst = StoragePool.pool_list_from_sources(self.conn,
StoragePool.TYPE_ISCSI,
host=host)
self.assertTrue(len(lst) == 0)
示例4: testEnumerateLogical
# 需要導入模塊: from virtinst import StoragePool [as 別名]
# 或者: from virtinst.StoragePool import pool_list_from_sources [as 別名]
def testEnumerateLogical(self):
name = "pool-logical-list"
lst = StoragePool.pool_list_from_sources(self.conn,
StoragePool.TYPE_LOGICAL)
self._enumerateCompare(name, lst)