basic_deployment.py 文件源码

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

项目:charm-heat 作者: openstack 项目源码 文件源码
def test_500_auth_encryption_key_same_on_units(self):
        """Test that the auth_encryption_key in heat.conf is the same on all of
        the units.
        """
        u.log.debug("Checking the 'auth_encryption_key' is the same on "
                    "all units.")
        output, ret = self._run_arbitrary(
            "--application heat "
            "--format json "
            "grep auth_encryption_key /etc/heat/heat.conf")
        if ret:
            msg = "juju run returned error: ({}) -> {}".format(ret, output)
            amulet.raise_status(amulet.FAIL, msg=msg)
        output = json.loads(output)
        keys = {}
        for r in output:
            k = r['Stdout'].split('=')[1].strip()
            keys[r['UnitId']] = k
        # see if keys are different.
        ks = keys.values()
        if any(((k != ks[0]) for k in ks[1:])):
            msg = ("'auth_encryption_key' is not identical on every unit: {}"
                   .format("{}={}".format(k, v) for k, v in keys.items()))
            amulet.raise_status(amulet.FAIL, msg=msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号