本文整理汇总了Python中pulp_node.manifest.Manifest.has_valid_units方法的典型用法代码示例。如果您正苦于以下问题:Python Manifest.has_valid_units方法的具体用法?Python Manifest.has_valid_units怎么用?Python Manifest.has_valid_units使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp_node.manifest.Manifest
的用法示例。
在下文中一共展示了Manifest.has_valid_units方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _unit_inventory
# 需要导入模块: from pulp_node.manifest import Manifest [as 别名]
# 或者: from pulp_node.manifest.Manifest import has_valid_units [as 别名]
def _unit_inventory(self, request):
"""
Build the unit inventory.
:param request: A synchronization request.
:type request: SyncRequest
:return: The built inventory.
:rtype: UnitInventory
"""
# fetch child units
try:
conduit = NodesConduit()
child_units = conduit.get_units(request.repo_id)
except NodeError:
raise
except Exception:
_log.exception(request.repo_id)
raise GetChildUnitsError(request.repo_id)
# fetch parent units
try:
request.progress.begin_manifest_download()
url = request.config.get(constants.MANIFEST_URL_KEYWORD)
manifest = Manifest(request.working_dir)
try:
manifest.read()
except IOError, e:
if e.errno == errno.ENOENT:
pass
except ValueError:
# json decoding failed
pass
fetched_manifest = RemoteManifest(url, request.downloader, request.working_dir)
fetched_manifest.fetch()
if manifest != fetched_manifest or \
not manifest.is_valid() or not manifest.has_valid_units():
fetched_manifest.write()
fetched_manifest.fetch_units()
manifest = fetched_manifest
if not manifest.is_valid():
raise InvalidManifestError()