universe_builder.py 文件源码

python
阅读 41 收藏 0 点赞 0 评论 0

项目:dcos-rabbitmq 作者: sheepkiller 项目源码 文件源码
def _generate_packages_dict(self, package_files):
        package_json = json.loads(package_files[_package_json_filename], object_pairs_hook=collections.OrderedDict)
        package_json['releaseVersion'] = 0
        package_json['packagingVersion'] = '{}.0'.format(self._cosmos_packaging_version)

        command_json = package_files.get(_command_json_filename)
        if command_json is not None:
            package_json['command'] = json.loads(command_json, object_pairs_hook=collections.OrderedDict)

        config_json = package_files.get(_config_json_filename)
        if config_json is not None:
            package_json['config'] = json.loads(config_json, object_pairs_hook=collections.OrderedDict)

        marathon_json = package_files.get(_marathon_json_filename)
        if marathon_json is not None:
            package_json['marathon'] = {
                'v2AppMustacheTemplate': base64.standard_b64encode(bytearray(marathon_json, 'utf-8')).decode()}

        resource_json = package_files.get(_resource_json_filename)
        if resource_json is not None:
            package_json['resource'] = json.loads(resource_json, object_pairs_hook=collections.OrderedDict)

        return {'packages': [package_json]}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号